fix: authenticator crashing when session token invalid
This commit is contained in:
parent
ca5b14fc13
commit
da0e33fb1b
@ -42,7 +42,7 @@ func (r *Authenticator) Authenticate(path string, exceptions []string) func(next
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
session, error := r.userManager.GetSession(cookie.Value)
|
session, error := r.userManager.GetSession(cookie.Value)
|
||||||
if error != nil {
|
if error != nil || session == nil {
|
||||||
SendError(401, context, fmt.Sprintf("session not found: %s", cookie.Value))
|
SendError(401, context, fmt.Sprintf("session not found: %s", cookie.Value))
|
||||||
return fmt.Errorf("session not found: %s", cookie.Value)
|
return fmt.Errorf("session not found: %s", cookie.Value)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user