1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-11-29 22:48:19 +02:00

Streamline ErrMissingCode in provider Redeem methods

This commit is contained in:
Nick Meves
2020-10-23 19:35:15 -07:00
parent b92fd4b0bb
commit 1b3b00443a
6 changed files with 36 additions and 37 deletions

View File

@@ -394,7 +394,7 @@ func (p *OAuthProxy) GetRedirectURI(host string) string {
func (p *OAuthProxy) redeemCode(ctx context.Context, host, code string) (*sessionsapi.SessionState, error) {
if code == "" {
return nil, errors.New("missing code")
return nil, providers.ErrMissingCode
}
redirectURI := p.GetRedirectURI(host)
s, err := p.provider.Redeem(ctx, redirectURI, code)