Force relogin after webui data changes
- Add a force_relogin flag to user_pref - Return 404 for main.php requests when the user must reauthenticate - Clear the relogin flag after successful client login - Mark users for relogin after webui card import, accessory changes, and profile updates Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
@@ -111,6 +111,11 @@ func upload(ctx *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if err := usermodel.MarkUserForceRelogin(db.UserEng, ctx.GetInt("userid")); err != nil {
|
||||
ctx.JSON(http.StatusOK, ErrMsg{Error: 1, Msg: "卡片添加成功,但登录状态刷新失败!"})
|
||||
return
|
||||
}
|
||||
|
||||
ctx.JSON(http.StatusOK, ErrMsg{Error: 0, Msg: "导入成功,请重新打开游戏!"})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user