1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

Add the user_id directly on oauth2_sessions and make the scope a text list

This commit is contained in:
Quentin Gliech
2023-08-29 12:32:22 +02:00
parent feb59344f3
commit 438a10332a
21 changed files with 186 additions and 127 deletions

View File

@@ -296,9 +296,14 @@ async fn authorization_code_grant(
}
};
let Some(user_session_id) = session.user_session_id else {
tracing::warn!("No user session associated with this OAuth2 session");
return Err(RouteError::InvalidGrant);
};
let browser_session = repo
.browser_session()
.lookup(session.user_session_id)
.lookup(user_session_id)
.await?
.ok_or(RouteError::NoSuchBrowserSession)?;