Skip to content

Commit

Permalink
fix: improve oauth2 reason codes for failures
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Trost <[email protected]>
  • Loading branch information
galexrt committed May 15, 2024
1 parent 3606f19 commit eced9cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/server/oauth2/oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ func (o *OAuth2) Login(c *gin.Context) {
connectOnly, err = strconv.ParseBool(connectOnlyVal)
if err != nil {
o.logger.Error("failed to parse connect only var", zap.Error(err))
o.handleRedirect(c, false, false, "invalid_request")
o.handleRedirect(c, false, false, "invalid_request_connect_only")
return
}
}

tokenVal, err := c.Cookie("fivenet_token")
if err != nil {
o.logger.Error("failed to parse token cookie", zap.Error(err))
o.handleRedirect(c, false, false, "invalid_request")
o.handleRedirect(c, false, false, "invalid_request_token")
return
}
if tokenVal != "" {
Expand Down Expand Up @@ -232,7 +232,7 @@ func (o *OAuth2) Callback(c *gin.Context) {
sess.Save()

if c.Request.FormValue("state") != state {
o.handleRedirect(c, connectOnly, false, "invalid_state")
o.handleRedirect(c, connectOnly, false, "invalid_state_404")
return
}

Expand Down

0 comments on commit eced9cb

Please sign in to comment.