1
0
mirror of https://github.com/volatiletech/authboss.git synced 2024-11-24 08:42:17 +02:00

Fix bug in LoadCurrentUser error handling

This commit is contained in:
Aaron L 2018-09-17 20:42:03 -07:00
parent 8213e87e83
commit dc5a3def97
2 changed files with 8 additions and 4 deletions

View File

@ -20,6 +20,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- defaults.HTTPRedirector now always responds with a "status": "success" - defaults.HTTPRedirector now always responds with a "status": "success"
when responding to an API unless there's a failure. when responding to an API unless there's a failure.
### Fixed
- Fix LoadCurrentUser error handling, it was swallowing errors when users were
not logged in, changed to be consistent, now returns ErrUserNotFound just like
CurrentUser.
## [2.0.0] - 2018-09-03 ## [2.0.0] - 2018-09-03
### Added ### Added

View File

@ -131,10 +131,8 @@ func (a *Authboss) LoadCurrentUser(r **http.Request) (User, error) {
pid, err := a.LoadCurrentUserID(r) pid, err := a.LoadCurrentUserID(r)
if err != nil { if err != nil {
return nil, err return nil, err
} } else if len(pid) == 0 {
return nil, ErrUserNotFound
if len(pid) == 0 {
return nil, nil
} }
ctx := (**r).Context() ctx := (**r).Context()