mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-18 15:56:41 +02:00
Add JWT middleware validation failure log (#760)
We will log the middleware log now, but in the next releases we should provide a generic error that can be parsed by the dashboard.
This commit is contained in:
parent
e6292e3124
commit
a27fe4326c
@ -4,12 +4,14 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/golang-jwt/jwt"
|
||||
"github.com/netbirdio/netbird/management/server/http/util"
|
||||
"github.com/netbirdio/netbird/management/server/status"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/golang-jwt/jwt"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/netbirdio/netbird/management/server/http/util"
|
||||
"github.com/netbirdio/netbird/management/server/status"
|
||||
)
|
||||
|
||||
// A function called whenever an error is encountered
|
||||
@ -114,6 +116,9 @@ func (m *JWTMiddleware) Handler(h http.Handler) http.Handler {
|
||||
|
||||
// If there was an error, do not continue.
|
||||
if err != nil {
|
||||
log.Errorf("received an error while validating the JWT token: %s. "+
|
||||
"Review your IDP configuration and ensure that "+
|
||||
"settings are in sync between dashboard and management", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user