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
No known key found for this signature in database
GPG Key ID: 6E80578D6751DEFB
1 changed files with 2 additions and 5 deletions

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 {