You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-12-03 22:51:11 +03:00
data-model: Make the user_id optional in the OAuth 2.0 sessions
This commit is contained in:
@@ -135,7 +135,6 @@ impl<'c> OAuth2AccessTokenRepository for PgOAuth2AccessTokenRepository<'c> {
|
||||
fields(
|
||||
db.statement,
|
||||
%session.id,
|
||||
user.id = %session.user_id,
|
||||
client.id = %session.client_id,
|
||||
access_token.id,
|
||||
),
|
||||
|
||||
@@ -406,7 +406,6 @@ impl<'c> OAuth2AuthorizationGrantRepository for PgOAuth2AuthorizationGrantReposi
|
||||
%grant.id,
|
||||
client.id = %grant.client_id,
|
||||
%session.id,
|
||||
user.id = %session.user_id,
|
||||
),
|
||||
err,
|
||||
)]
|
||||
|
||||
@@ -143,7 +143,6 @@ impl<'c> OAuth2RefreshTokenRepository for PgOAuth2RefreshTokenRepository<'c> {
|
||||
fields(
|
||||
db.statement,
|
||||
%session.id,
|
||||
user.id = %session.user_id,
|
||||
client.id = %session.client_id,
|
||||
refresh_token.id,
|
||||
),
|
||||
|
||||
@@ -86,7 +86,7 @@ impl TryFrom<OAuthSessionLookup> for Session {
|
||||
state,
|
||||
created_at: value.created_at,
|
||||
client_id: value.oauth2_client_id.into(),
|
||||
user_id: value.user_id.into(),
|
||||
user_id: Some(value.user_id.into()),
|
||||
user_session_id: value.user_session_id.map(Ulid::from),
|
||||
scope,
|
||||
})
|
||||
@@ -186,7 +186,7 @@ impl<'c> OAuth2SessionRepository for PgOAuth2SessionRepository<'c> {
|
||||
id,
|
||||
state: SessionState::Valid,
|
||||
created_at,
|
||||
user_id: user_session.user.id,
|
||||
user_id: Some(user_session.user.id),
|
||||
user_session_id: Some(user_session.id),
|
||||
client_id: client.id,
|
||||
scope,
|
||||
@@ -200,7 +200,6 @@ impl<'c> OAuth2SessionRepository for PgOAuth2SessionRepository<'c> {
|
||||
db.statement,
|
||||
%session.id,
|
||||
%session.scope,
|
||||
user.id = %session.user_id,
|
||||
client.id = %session.client_id,
|
||||
),
|
||||
err,
|
||||
|
||||
Reference in New Issue
Block a user