Update
Some checks failed
ci/woodpecker/push/workflow Pipeline failed

This commit is contained in:
PB
2025-12-13 15:55:27 +01:00
parent cc0bd22cac
commit e7478ae657
6 changed files with 19 additions and 14 deletions

View File

@@ -90,7 +90,7 @@ func (s *Server) setupRouter() {
Post("/login", http.LoginHandlerFn(s.GetDatabase(), s.GetCache())).
Post("/refresh", http.RefreshHandlerFn(s.GetDatabase(), s.GetCache())). // add JWTProtected() and get token from Auth Bearer header not from the body?
Post("/register", http.RegisterHandlerFn(s.GetDatabase(), s.GetCache())).
Get("/access", JWTProtected(), http.AccessHandlerFn(s.GetDatabase(), s.GetCache()))
Get("/access" /*JWTProtected(), */, http.AccessHandlerFn(s.GetDatabase(), s.GetCache()))
}
func (s *Server) setupMiddleware() {
@@ -100,10 +100,9 @@ func (s *Server) setupMiddleware() {
func LoggingMiddleware() func(c *fiber.Ctx) error {
return func(c *fiber.Ctx) error {
log.Printf("Request: %s, remote: %s, via: %s",
log.Printf("Request: %s, remote: %s",
c.Request().URI().String(),
c.Context().RemoteIP().String(),
string(c.Context().UserAgent()),
)
return c.Next()