feat: Return a specific error when trying to revoke a static access token

This commit is contained in:
Ginger committed 2026-12-02 22:58:20 -05:00
1 parent c3db121b05
commit fd0fd54aab
1 file changed
+5 -1
+5 -1
View File
@@ -614,8 +614,12 @@ impl Service {
self.services.users.find_from_token(&token).await self.services.users.find_from_token(&token).await
{ {
(user_id, device_id) (user_id, device_id)
} else if self.get_client_credentials_session(&token).is_some() {
return Err(OAuthError::invalid_grant(
"Access tokens for static clients cannot be revoked.",
));
} else { } else {
return Err(OAuthError::invalid_grant("Invalid access or refresh token")); return Err(OAuthError::invalid_grant("Invalid access or refresh token."));
}; };
// This will also call [`Self::remove_session`] // This will also call [`Self::remove_session`]