RefreshTokens 续登路径补发首次试用,修复自动续登老用户授权停留「未激活」。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2Wdwo7SmgBJU37cBrkhPK
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user