Skip to content

Commit

Permalink
Don't send stacktrace when err is AuthorizationPending
Browse files Browse the repository at this point in the history
  • Loading branch information
supercairos committed Dec 7, 2023
1 parent 10419a9 commit 5bc8783
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion handler/oauth2/flow_generic_code_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ func (c *GenericCodeTokenEndpointHandler) HandleTokenEndpointRequest(ctx context
}
return errorsx.WithStack(fosite.ErrInvalidGrant.WithHint(hint).WithDebug(debug))
} else if errors.Is(err, fosite.ErrAuthorizationPending) {
return errorsx.WithStack(err)
// Don't print a stacktrace as it spams logs
return err
} else if err != nil && errors.Is(err, fosite.ErrNotFound) {
return errorsx.WithStack(fosite.ErrInvalidGrant.WithWrap(err).WithDebug(err.Error()))
} else if err != nil {
Expand Down

0 comments on commit 5bc8783

Please sign in to comment.