feat: improve logs, remove config for disable authentication
This commit is contained in:
+2
-5
@@ -7,7 +7,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/deluan/navidrome/assets"
|
||||
"github.com/deluan/navidrome/conf"
|
||||
"github.com/deluan/navidrome/model"
|
||||
"github.com/deluan/rest"
|
||||
"github.com/go-chi/chi"
|
||||
@@ -46,10 +45,8 @@ func (app *Router) routes() http.Handler {
|
||||
r.Post("/createAdmin", CreateAdmin(app.ds))
|
||||
|
||||
r.Route("/api", func(r chi.Router) {
|
||||
if !conf.Server.DevDisableAuthentication {
|
||||
r.Use(jwtauth.Verifier(TokenAuth))
|
||||
r.Use(Authenticator(app.ds))
|
||||
}
|
||||
r.Use(jwtauth.Verifier(TokenAuth))
|
||||
r.Use(Authenticator(app.ds))
|
||||
app.R(r, "/user", model.User{})
|
||||
app.R(r, "/song", model.MediaFile{})
|
||||
app.R(r, "/album", model.Album{})
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/deluan/navidrome/conf"
|
||||
"github.com/deluan/navidrome/engine"
|
||||
"github.com/deluan/navidrome/server/subsonic/responses"
|
||||
"github.com/go-chi/chi"
|
||||
@@ -48,11 +47,9 @@ func (api *Router) routes() http.Handler {
|
||||
r.Use(postFormToQueryParams)
|
||||
r.Use(checkRequiredParameters)
|
||||
|
||||
// Add validation middleware if not disabled
|
||||
if !conf.Server.DevDisableAuthentication {
|
||||
r.Use(authenticate(api.Users))
|
||||
// TODO Validate version
|
||||
}
|
||||
// Add validation middleware
|
||||
r.Use(authenticate(api.Users))
|
||||
// TODO Validate version
|
||||
|
||||
// Subsonic endpoints, grouped by controller
|
||||
r.Group(func(r chi.Router) {
|
||||
|
||||
Reference in New Issue
Block a user