OpenID routes

Co-Authored-By: Matthias Ahouansou <matthias@ahouansou.cz>
This commit is contained in:
mikoto 2024-05-28 00:22:11 +02:00 committed by Matthias Ahouansou
parent 47aadcea1d
commit a888c7cb16
No known key found for this signature in database
10 changed files with 127 additions and 4 deletions

View file

@ -102,10 +102,15 @@ where
let (sender_user, sender_device, sender_servername, appservice_info) =
match (metadata.authentication, token) {
(_, Token::Invalid) => {
return Err(Error::BadRequest(
ErrorKind::UnknownToken { soft_logout: false },
"Unknown access token.",
))
// OpenID endpoint uses a query param with the same name, drop this once query params for user auth are removed from the spec
if query_params.access_token.is_some() {
(None, None, None, None)
} else {
return Err(Error::BadRequest(
ErrorKind::UnknownToken { soft_logout: false },
"Unknown access token.",
));
}
}
(AuthScheme::AccessToken, Token::Appservice(info)) => {
let user_id = query_params