strawberry
2024-06-06 03:43:21 -04:00
parent 3af153f5ae
commit 8428f43c78
4 changed files with 28 additions and 13 deletions
+1
View File
@@ -17,6 +17,7 @@ crate-type = [
]
[features]
element_hacks = []
dev_release_log_level = []
release_max_log_level = [
"tracing/max_level_trace",
+14 -1
View File
@@ -58,9 +58,22 @@ impl Service {
AuthData::Password(Password {
identifier,
password,
#[cfg(feature = "element_hacks")]
user,
..
}) => {
let UserIdentifier::UserIdOrLocalpart(username) = identifier else {
#[cfg(feature = "element_hacks")]
let username = if let Some(UserIdentifier::UserIdOrLocalpart(username)) = identifier {
username
} else if let Some(username) = user {
username
} else {
return Err(Error::BadRequest(ErrorKind::Unrecognized, "Identifier type not recognized."));
};
#[cfg(not(feature = "element_hacks"))]
let Some(UserIdentifier::UserIdOrLocalpart(username)) = identifier
else {
return Err(Error::BadRequest(ErrorKind::Unrecognized, "Identifier type not recognized."));
};