mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-12-03 05:47:33 +00:00
feat: Return a specific error when trying to revoke a static access token
This commit is contained in:
1 file changed
+5
-1
@@ -614,8 +614,12 @@ impl Service {
|
||||
self.services.users.find_from_token(&token).await
|
||||
{
|
||||
(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 {
|
||||
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`]
|
||||
|
||||
Reference in new issue
Block a user