Do not tie tokens to a user app.

This commit is contained in:
Rogier Reerink
2026-10-08 15:09:06 +02:00
parent d12fe3af7d
commit 15b229b0de
8 changed files with 24 additions and 31 deletions
+2 -3
View File
@@ -40,7 +40,7 @@ async fn issue_token(
}
let generated = generate_token_pair()?;
repository::tokens::issue(&pool, token(client_id, &generated)).await?;
repository::tokens::issue(&pool, token(&generated)).await?;
Ok(Json(token_response(
generated.access_token,
@@ -110,10 +110,9 @@ fn generate_token_pair() -> Result<GeneratedTokenPair, AppError> {
})
}
fn token(app_id: Uuid, generated: &GeneratedTokenPair) -> Token {
fn token(generated: &GeneratedTokenPair) -> Token {
Token {
id: Uuid::new_v4(),
app_id,
access_token_hash: generated.access_token_hash.clone(),
refresh_token_hash: generated.refresh_token_hash.clone(),
access_expires_at: generated.access_expires_at,