refactor: raw struct for store

This commit is contained in:
boojack
2022-05-19 18:32:04 +08:00
parent 0b50122aac
commit bc22f69ac5
22 changed files with 687 additions and 188 deletions

View File

@ -85,6 +85,8 @@ func BasicAuthMiddleware(s *Server, next echo.HandlerFunc) echo.HandlerFunc {
}
if user == nil {
return echo.NewHTTPError(http.StatusUnauthorized, fmt.Sprintf("Not found user ID: %d", userID))
} else if user.RowStatus == api.Archived {
return echo.NewHTTPError(http.StatusForbidden, fmt.Sprintf("User has been archived with email %s", user.Email))
}
// Stores userID into context.