add legacy element hack for UIAA using invalid user
field
see:
- e9302a9556
- https://github.com/element-hq/element-android/issues/8043
- https://github.com/element-hq/element-ios/issues/7405
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
3af153f5ae
commit
8428f43c78
4 changed files with 28 additions and 13 deletions
|
@ -67,6 +67,7 @@ dev_release_log_level = [
|
|||
]
|
||||
element_hacks = [
|
||||
"conduit-api/element_hacks",
|
||||
"conduit-service/element_hacks",
|
||||
]
|
||||
gzip_compression = [
|
||||
"conduit-api/gzip_compression",
|
||||
|
|
|
@ -17,6 +17,7 @@ crate-type = [
|
|||
]
|
||||
|
||||
[features]
|
||||
element_hacks = []
|
||||
dev_release_log_level = []
|
||||
release_max_log_level = [
|
||||
"tracing/max_level_trace",
|
||||
|
|
|
@ -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."));
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue