mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-12-27 21:13:47 +03:00
fix(appservices): don't perform identity assertion when auth is optional
This commit is contained in:
parent
1474b94db6
commit
6c9c1b5afe
1 changed files with 7 additions and 7 deletions
|
@ -107,10 +107,7 @@ where
|
||||||
"Unknown access token.",
|
"Unknown access token.",
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
(
|
(AuthScheme::AccessToken, Token::Appservice(info)) => {
|
||||||
AuthScheme::AccessToken | AuthScheme::AccessTokenOptional,
|
|
||||||
Token::Appservice(info),
|
|
||||||
) => {
|
|
||||||
let user_id = query_params
|
let user_id = query_params
|
||||||
.user_id
|
.user_id
|
||||||
.map_or_else(
|
.map_or_else(
|
||||||
|
@ -135,9 +132,12 @@ where
|
||||||
// TODO: Check if appservice is allowed to be that user
|
// TODO: Check if appservice is allowed to be that user
|
||||||
(Some(user_id), None, None, true)
|
(Some(user_id), None, None, true)
|
||||||
}
|
}
|
||||||
(AuthScheme::None | AuthScheme::AppserviceToken, Token::Appservice(_)) => {
|
(
|
||||||
(None, None, None, true)
|
AuthScheme::None
|
||||||
}
|
| AuthScheme::AppserviceToken
|
||||||
|
| AuthScheme::AccessTokenOptional,
|
||||||
|
Token::Appservice(_),
|
||||||
|
) => (None, None, None, true),
|
||||||
(AuthScheme::AccessToken, Token::None) => {
|
(AuthScheme::AccessToken, Token::None) => {
|
||||||
return Err(Error::BadRequest(
|
return Err(Error::BadRequest(
|
||||||
ErrorKind::MissingToken,
|
ErrorKind::MissingToken,
|
||||||
|
|
Loading…
Reference in a new issue