Mark access token as used when calling the userinfo endpoint

This commit is contained in:
Quentin Gliech
2024-12-10 17:45:52 +01:00
parent 6bda8b91d0
commit 6b1b3abfe9
2 changed files with 7 additions and 0 deletions

View File

@@ -117,6 +117,11 @@ impl<F: Send> UserAuthorization<F> {
return Err(AuthorizationVerificationError::InvalidToken);
}
if !token.is_used() {
// Mark the token as used
repo.oauth2_access_token().mark_used(clock, token).await?;
}
Ok(session)
}
}

View File

@@ -142,6 +142,8 @@ pub async fn get(
.await?
.ok_or(RouteError::NoSuchClient)?;
repo.save().await?;
if let Some(alg) = client.userinfo_signed_response_alg {
let key = key_store
.signing_key_for_algorithm(&alg)