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.
This commit is contained in:
Jade Ellis committed 2026-11-27 18:41:45 +00:00
1 parent 47828dd8c2
commit 7bdfea0704
1 file changed
+2 -2
+2 -2
View File
@@ -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),