diff --git a/src/service/oauth/mod.rs b/src/service/oauth/mod.rs index 6bea19c40..047cdb5c2 100644 --- a/src/service/oauth/mod.rs +++ b/src/service/oauth/mod.rs @@ -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`]