Skip to content

Commit

Permalink
fix bug of valid type
Browse files Browse the repository at this point in the history
  • Loading branch information
Jing-ze committed Dec 26, 2024
1 parent 93154eb commit cbd6dd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions oauthproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ func (p *OAuthProxy) OAuthCallback(rw http.ResponseWriter, req *http.Request) {
util.SendError("Invalid authentication via OAuth2: unauthorized", rw, http.StatusForbidden)
}
}
err, isAsync := p.provider.ValidateSession(req.Context(), session, p.client, validateSessionCallback, p.provider.Data().RedeemTimeout)
if err != nil {
valid, isAsync := p.provider.ValidateSession(req.Context(), session, p.client, validateSessionCallback, p.provider.Data().RedeemTimeout)
if !valid {
util.SendError(fmt.Sprintf("Session validation failed: %s", session), rw, http.StatusForbidden)
return
} else if !isAsync {
Expand Down

0 comments on commit cbd6dd1

Please sign in to comment.