GODT-1524: Logout issues with macOS.

This commit is contained in:
Jakub
2022-03-14 16:37:42 +01:00
parent 2d5ea669a5
commit 6671dd38ea
26 changed files with 411 additions and 135 deletions

View File

@ -74,12 +74,12 @@ func (ctl *Controller) createSession(username string, hasFullScope bool) *fakeSe
func (ctl *Controller) refreshSessionIfAuthorized(uid, ref string) (*fakeSession, error) {
session, ok := ctl.sessionsByUID[uid]
if !ok {
return nil, pmapi.ErrUnauthorized
if !ok || session.uid != uid {
return nil, pmapi.ErrAuthFailed{OriginalError: errors.New("bad uid")}
}
if ref != session.ref {
return nil, pmapi.ErrUnauthorized
return nil, pmapi.ErrAuthFailed{OriginalError: errors.New("bad refresh token")}
}
session.ref = ctl.tokenGenerator.next("ref")