Add: handle not active user

This commit is contained in:
2021-12-13 14:28:24 +08:00
parent ab67575976
commit f1e8dcfad4
4 changed files with 11 additions and 4 deletions

View File

@@ -94,6 +94,12 @@ func (api *API) HandleLogin(w http.ResponseWriter, r *http.Request) {
}
}
// if user is not active
if !user.Active {
api.HandleError(w, r, ErrNotActive)
return
}
// save session
session.Values["userId"] = user.ID
err = session.Save(r, w)