1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-08-10 22:51:31 +02:00

Remove one return statement in getValidatedSession

This commit is contained in:
Kevin Kreitner
2021-09-29 17:07:50 +02:00
committed by Joel Speed
parent 86ba2f41ce
commit c6d8cd1ea4

View File

@@ -96,13 +96,10 @@ func (s *storedSessionLoader) loadSession(next http.Handler) http.Handler {
// that is is valid.
func (s *storedSessionLoader) getValidatedSession(rw http.ResponseWriter, req *http.Request) (*sessionsapi.SessionState, error) {
session, err := s.store.Load(req)
if err != nil {
if err != nil || session == nil {
// No session was found in the storage or error occurred, nothing more to do
return nil, err
}
if session == nil {
// No session was found in the storage, nothing more to do
return nil, nil
}
err = s.refreshSessionIfNeeded(rw, req, session)
if err != nil {