Skip to content

Commit

Permalink
fix: handle general http error
Browse files Browse the repository at this point in the history
  • Loading branch information
J0 committed Dec 3, 2024
1 parent 5578924 commit 874b175
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/api/token_oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,11 @@ func (a *API) IdTokenGrant(ctx context.Context, w http.ResponseWriter, r *http.R

return nil
}); err != nil {
if err.ErrorCode == ErrorCodeUserBanned {
return forbiddenError(ErrorCodeUserBanned, "User is banned")
}
switch err.(type) {
case *storage.CommitWithError:
return err
case *HTTPError:
return err
default:
return oauthError("server_error", "Internal Server Error").WithInternalError(err)
}
Expand Down

0 comments on commit 874b175

Please sign in to comment.