feat: implement token expiration watcher
This commit is contained in:
@ -243,10 +243,12 @@ func (u *User) authorizeAndUnlock() (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (u *User) ReceiveAPIAuth(auth *pmapi.Auth) {
|
||||
func (u *User) AuthorizeWithAPIAuth(auth *pmapi.Auth) {
|
||||
u.lock.Lock()
|
||||
defer u.lock.Unlock()
|
||||
|
||||
u.log.Debug("User received auth from bridge")
|
||||
|
||||
if auth == nil {
|
||||
if err := u.logout(); err != nil {
|
||||
u.log.WithError(err).Error("Failed to logout user after receiving empty auth from API")
|
||||
|
||||
Reference in New Issue
Block a user