fix: restore soft-deleted users on login
This commit is contained in:
@@ -122,12 +122,9 @@ func GitHubOAuth(c *gin.Context) {
|
||||
})
|
||||
return
|
||||
}
|
||||
// if user.Id == 0 , user has been deleted
|
||||
if user.Id == 0 {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"success": false,
|
||||
"message": "用户已注销",
|
||||
})
|
||||
if err := user.RestoreIfDeleted("github", 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