Fix more lint issues

This commit is contained in:
Joe Stump 2026-01-02 21:47:18 +00:00
parent c0aea82e07
commit d22bd51eeb
No known key found for this signature in database
GPG Key ID: 29151C3EC48A0EB9

View File

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