fix(auth): synchronize need_change_password across login, user-info and repositories

This commit is contained in:
ryan
2026-08-29 11:49:14 +08:00
parent 107251891f
commit d3d7c783a9
4 changed files with 32 additions and 6 deletions
+1 -1
View File
@@ -440,7 +440,7 @@ func handleCallbackRegister(ctx context.Context, c *gin.Context, source *AuthSou
func UserInfo(c *gin.Context) {
user, _ := ginutil.GetFromContext[*contracts.UserDTO](c, contracts.AuthUserObjKey)
session := sessions.Default(c)
needChange := session.Get("need_change_password") == true
needChange := session.Get("need_change_password") == true || (user != nil && user.NeedChangePassword)
c.JSON(
http.StatusOK,