fix: err is nil (#914)

This commit is contained in:
Yening Qin 2022-04-15 14:35:26 +08:00 committed by GitHub
parent e8cfe46381
commit 6033a0a743
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package router
import (
"context"
"errors"
"fmt"
"net/http"
"strconv"
@ -195,7 +196,7 @@ func extractTokenMetadata(r *http.Request) (*AccessDetails, error) {
if ok && token.Valid {
accessUuid, ok := claims["access_uuid"].(string)
if !ok {
return nil, err
return nil, errors.New("failed to parse access_uuid from jwt")
}
return &AccessDetails{