1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-31 09:24:31 +03:00

data-model: make the access token expiration optional

This commit is contained in:
Quentin Gliech
2023-09-11 11:16:12 +02:00
parent 83ca90ee3d
commit e6b91c1ce4
6 changed files with 79 additions and 18 deletions

View File

@ -187,7 +187,9 @@ impl OAuth2SessionMutations {
.add(&mut rng, &clock, &session, access_token, ttl)
.await?;
let refresh_token = if !permanent {
let refresh_token = if permanent {
None
} else {
let refresh_token = TokenType::RefreshToken.generate(&mut rng);
let refresh_token = repo
@ -196,8 +198,6 @@ impl OAuth2SessionMutations {
.await?;
Some(refresh_token)
} else {
None
};
Ok(CreateOAuth2SessionPayload {