chore: release server-v1.0.58
Deploy Server / release-deploy-server (push) Successful in 48s

RefreshTokens 续登路径补发首次试用,修复自动续登老用户授权停留「未激活」。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2Wdwo7SmgBJU37cBrkhPK
This commit is contained in:
wangjia
2026-06-18 19:14:25 +08:00
parent e3c8350d03
commit 2d84bda99a
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -419,6 +419,11 @@ func (s *AuthService) RefreshTokens(refreshToken string) (*TokenPair, error) {
Update("last_seen_at", time.Now())
}
// 自动续登(refresh)路径同样补发首次试用:老用户用本地 refresh token 自动登录、
// 从不走 Login(),否则永远停留在「未激活」。须在 issueTokens 之前,使新 JWT 的
// lic_exp 带上试用到期日。
s.ensureTrialOnFirstUse(user.ShopID)
return s.issueTokens(user.ID, user.ShopID, user.Role, claims.SID)
}