Skip to content

Commit

Permalink
fix bug of resume flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Jing-ze committed Dec 26, 2024
1 parent 10767df commit e98bf3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pkg/middleware/stored_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func (s *StoredSessionLoader) loadSession(next http.Handler) http.Handler {
updateKeysCallback := func(args ...interface{}) {
resumeFlag := args[0].(bool)
validateSessionCallback := func(args ...interface{}) {
resumeFlag := args[0].(bool)
scope.Session = session
next.ServeHTTP(rw, req)
if resumeFlag {
Expand All @@ -118,10 +119,10 @@ func (s *StoredSessionLoader) loadSession(next http.Handler) http.Handler {
session = nil
}
if !isAsync {
validateSessionCallback()
validateSessionCallback(resumeFlag)
}
} else {
validateSessionCallback()
validateSessionCallback(resumeFlag)
}
}
keysNeedsUpdate := (session != nil) && (s.NeedsVerifier)
Expand Down
2 changes: 1 addition & 1 deletion providers/internal_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func validateToken(ctx context.Context, p Provider, accessToken string, header h
client.Get(endpoint, headerArray, func(statusCode int, responseHeaders http.Header, responseBody []byte) {
util.Logger.Debugf("%d GET %s %s", statusCode, stripToken(endpoint), responseBody)
if statusCode == 200 {
callback()
callback(true)
} else {
util.SendError(fmt.Sprintf("token validation request failed: status %d - %s", statusCode, responseBody), nil, http.StatusInternalServerError)
}
Expand Down

0 comments on commit e98bf3c

Please sign in to comment.