mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
Fix more lint issues
This commit is contained in:
parent
c0aea82e07
commit
d22bd51eeb
@ -237,7 +237,7 @@ func validateLoginLDAP(userRepo model.UserRepository, userName, password string)
|
||||
}
|
||||
|
||||
u, err := userRepo.FindByUsername(userName)
|
||||
if err == model.ErrNotFound {
|
||||
if errors.Is(err, model.ErrNotFound) {
|
||||
u = &model.User{UserName: userName}
|
||||
}
|
||||
u.Name = name
|
||||
@ -256,15 +256,6 @@ func validateLoginLDAP(userRepo model.UserRepository, userName, password string)
|
||||
return u, nil
|
||||
}
|
||||
|
||||
// This method maps the custom authorization header to the default 'Authorization', used by the jwtauth library
|
||||
func authHeaderMapper(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
bearer := r.Header.Get(consts.UIAuthorizationHeader)
|
||||
r.Header.Set("Authorization", bearer)
|
||||
next.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
||||
|
||||
func JWTVerifier(next http.Handler) http.Handler {
|
||||
return jwtauth.Verify(auth.TokenAuth, tokenFromHeader, jwtauth.TokenFromCookie, jwtauth.TokenFromQuery)(next)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user