feat: clear the session of a signin but non-existent user (#1246)

This commit is contained in:
xAmast
2022-10-29 20:18:02 +08:00
committed by GitHub
parent 9d5b019243
commit 25ee4226d3
3 changed files with 9 additions and 6 deletions

View File

@ -98,6 +98,7 @@ func (c *ApiController) RequireSignedInUser() (*object.User, bool) {
user := object.GetUser(userId)
if user == nil {
c.ClearUserSession()
c.ResponseError(fmt.Sprintf(c.T("UserErr.DoNotExist"), userId))
return nil, false
}