mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-12 19:56:48 +00:00
fix: Use correct error code for invalid client ID
This commit is contained in:
1 parent
4c9426a13f
commit
8f60648009
2 files changed
+3
-2
No files matched your search
@@ -195,6 +195,7 @@ pub enum ErrorCode {
|
||||
AccessDenied,
|
||||
InvalidScope,
|
||||
InvalidGrant,
|
||||
InvalidClient,
|
||||
InvalidClientMetadata,
|
||||
AuthorizationPending,
|
||||
ExpiredToken,
|
||||
|
||||
@@ -326,7 +326,7 @@ impl Service {
|
||||
query: DeviceCodeRequest,
|
||||
) -> Result<DeviceCodeResponse, OAuthError> {
|
||||
let Some(client_metadata) = self.get_client_metadata(&query.client_id).await else {
|
||||
return Err(OAuthError::invalid_grant("Invalid client ID"));
|
||||
return Err(OAuthError::new_static(ErrorCode::InvalidClient, "Invalid client ID"));
|
||||
};
|
||||
|
||||
let requested_scopes = query
|
||||
@@ -434,7 +434,7 @@ impl Service {
|
||||
let TokenRequest { client_id, request } = request;
|
||||
|
||||
let Some(client_metadata) = self.get_client_metadata(&client_id).await else {
|
||||
return Err(OAuthError::invalid_request("Invalid client ID"));
|
||||
return Err(OAuthError::new_static(ErrorCode::InvalidClient, "Invalid client ID"));
|
||||
};
|
||||
|
||||
if !client_metadata.grant_types.contains(&request.grant_type()) {
|
||||
|
||||
Reference in new issue
Block a user