diff --git a/internal/device/session.go b/internal/device/session.go index d407c858..49bf74b6 100644 --- a/internal/device/session.go +++ b/internal/device/session.go @@ -25,11 +25,9 @@ func Handle(userID uint, deviceKey, ua, ip string) error { now := time.Now().Unix() sess, err := db.GetSession(userID, deviceKey) if err == nil { - if sess.Status == model.SessionInactive { - return errors.WithStack(errs.SessionInactive) - } - sess.LastActive = now + // reactivate existing session if it was inactive sess.Status = model.SessionActive + sess.LastActive = now sess.UserAgent = ua sess.IP = ip return db.UpsertSession(sess)