@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user