fix(appservices): don't perform identity assertion when auth is optional
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
456a3f93bd
commit
eb10e7d39b
1 changed files with 5 additions and 4 deletions
|
@ -132,7 +132,7 @@ where
|
|||
"Unknown access token.",
|
||||
))
|
||||
},
|
||||
(AuthScheme::AccessToken | AuthScheme::AccessTokenOptional, Token::Appservice(info)) => {
|
||||
(AuthScheme::AccessToken, Token::Appservice(info)) => {
|
||||
let user_id = query_params
|
||||
.user_id
|
||||
.map_or_else(
|
||||
|
@ -156,9 +156,10 @@ where
|
|||
|
||||
(Some(user_id), None, None, Some(*info))
|
||||
},
|
||||
(AuthScheme::None | AuthScheme::AppserviceToken, Token::Appservice(info)) => {
|
||||
(None, None, None, Some(*info))
|
||||
},
|
||||
(
|
||||
AuthScheme::None | AuthScheme::AccessTokenOptional | AuthScheme::AppserviceToken,
|
||||
Token::Appservice(info),
|
||||
) => (None, None, None, Some(*info)),
|
||||
(AuthScheme::AccessToken, Token::None) => {
|
||||
return Err(Error::BadRequest(ErrorKind::MissingToken, "Missing access token."));
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue