1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2024-12-28 06:44:32 +01:00

Merge branch 'token-auth-fixes' into 'next'

Token auth fixes

Closes #430

See merge request famedly/conduit!633
This commit is contained in:
Timo Kösters 2024-04-15 19:46:48 +00:00
commit d22bf5182b

View file

@ -108,10 +108,7 @@ where
))
}
(
AuthScheme::AccessToken
| AuthScheme::AppserviceToken
| AuthScheme::AccessTokenOptional
| AuthScheme::None,
AuthScheme::AccessToken | AuthScheme::AccessTokenOptional,
Token::Appservice(info),
) => {
let user_id = query_params
@ -138,6 +135,9 @@ where
// TODO: Check if appservice is allowed to be that user
(Some(user_id), None, None, true)
}
(AuthScheme::None | AuthScheme::AppserviceToken, Token::Appservice(_)) => {
(None, None, None, true)
}
(AuthScheme::AccessToken, Token::None) => {
return Err(Error::BadRequest(
ErrorKind::MissingToken,