Added /register handler

This commit is contained in:
PB
2025-10-20 17:58:25 +02:00
parent 7adf6f1699
commit bff728234b
3 changed files with 42 additions and 3 deletions

View File

@@ -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)
}