Added /register handler
This commit is contained in:
@@ -12,7 +12,9 @@ func (s *Server) LoginHandlerFn(c *fiber.Ctx) error {
|
||||
return s.Error(c, fiber.StatusBadRequest, "Error parsing input")
|
||||
}
|
||||
|
||||
token, err := service.AuthService.Login(data.Username, data.Password)
|
||||
authSrv := service.NewAuthService(s.GetDatabase())
|
||||
|
||||
token, err := authSrv.Login(data.Username, data.Password)
|
||||
if err != nil {
|
||||
return fiber.NewError(fiber.StatusUnauthorized)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user