Check if the jwtToken is valid in authViewer. (#1785)

Closes #1514
This commit is contained in:
Thordur Bjornsson 2018-05-16 17:36:35 +02:00 committed by Mike Arpaia
parent b42e4bacf2
commit d7e1462d10

View File

@ -94,6 +94,9 @@ func authViewer(ctx context.Context, jwtKey string, bearerToken token.Token, svc
if err != nil {
return nil, authError{reason: err.Error()}
}
if jwtToken.Valid != true {
return nil, authError{reason: "invalid jwt token"}
}
claims, ok := jwtToken.Claims.(jwt.MapClaims)
if !ok {
return nil, authError{reason: "no jwt claims"}