chore: additional errors and error improvements that catch problems earlier

This commit is contained in:
David Sharnoff 2022-09-29 22:18:48 -07:00 committed by GitHub
parent 0d721d937e
commit c0badf2329
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -53,7 +53,7 @@ func ValidateAccessTokenRequest(ctx context.Context, tokenReq *oidc.AccessTokenR
return nil, nil, oidc.ErrInvalidGrant()
}
if !ValidateGrantType(client, oidc.GrantTypeCode) {
return nil, nil, oidc.ErrUnauthorizedClient()
return nil, nil, oidc.ErrUnauthorizedClient().WithDescription("client missing grant type " + string(oidc.GrantTypeCode))
}
if tokenReq.RedirectURI != authReq.GetRedirectURI() {
return nil, nil, oidc.ErrInvalidGrant().WithDescription("redirect_uri does not correspond")