fix: restore soft-deleted users on login
This commit is contained in:
@@ -212,11 +212,9 @@ func LinuxdoOAuth(c *gin.Context) {
|
||||
})
|
||||
return
|
||||
}
|
||||
if user.Id == 0 {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"success": false,
|
||||
"message": "用户已注销",
|
||||
})
|
||||
if err := user.RestoreIfDeleted("linuxdo", c.ClientIP()); err != nil {
|
||||
common.SysError(fmt.Sprintf("failed to restore user %d: %v", user.Id, err))
|
||||
common.ApiError(c, err)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user