From eae0095d9cf79fcbedd33f275f20fb18b4501a83 Mon Sep 17 00:00:00 2001 From: okatu-loli Date: Wed, 27 Aug 2025 19:18:08 +0800 Subject: [PATCH] fix(session): Fixed the session status update logic. - Removed the error returned when the session status is `SessionInactive`. - Updated the `LastActive` field of the session to always record the current time. --- internal/device/session.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/device/session.go b/internal/device/session.go index d407c858..6de76fa9 100644 --- a/internal/device/session.go +++ b/internal/device/session.go @@ -25,11 +25,8 @@ 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 sess.Status = model.SessionActive + sess.LastActive = now sess.UserAgent = ua sess.IP = ip return db.UpsertSession(sess)