From 7bdfea0704f6c020f3be37f66eddcd13ac2627f5 Mon Sep 17 00:00:00 2001 From: Jade Ellis Date: Fri, 27 Nov 2026 18:24:07 +0000 Subject: [PATCH] fix: Clear temporary scopes before building refresh response scope Temporary scopes are dropped on token refresh, so the returned scope list should not advertise them. --- src/service/oauth/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/service/oauth/mod.rs b/src/service/oauth/mod.rs index 81a48426a..61bc7037c 100644 --- a/src/service/oauth/mod.rs +++ b/src/service/oauth/mod.rs @@ -777,6 +777,8 @@ impl Service { panic!("refresh token is not current or previous for its session"); } + session_info.temporary_scopes.clear(); + let scope = session_info.scope_string(&refresh_token_info.device_id); let new_access_token = DeviceToken::new_random().with_max_age(Self::ACCESS_TOKEN_MAX_AGE); @@ -791,8 +793,6 @@ impl Service { .await .expect("should be able to set token"); - session_info.temporary_scopes.clear(); - self.db.userdeviceid_oauthsessioninfo.put( (&refresh_token_info.user_id, &refresh_token_info.device_id), Json(session_info),