cli/internal/oauth: don't use naked returns (nakedret)
cli/internal/oauth/jwt.go:62:3: naked return in func `GetClaims` with 9 lines of code (nakedret) return ^ cli/internal/oauth/jwt.go:67:2: naked return in func `GetClaims` with 9 lines of code (nakedret) return ^ Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
88a019a9bb
commit
e569b9f74a
@ -56,15 +56,19 @@ type Source struct {
|
||||
}
|
||||
|
||||
// GetClaims returns claims from an access token without verification.
|
||||
func GetClaims(accessToken string) (claims Claims, err error) {
|
||||
func GetClaims(accessToken string) (Claims, error) {
|
||||
token, err := parseSigned(accessToken)
|
||||
if err != nil {
|
||||
return
|
||||
return Claims{}, err
|
||||
}
|
||||
|
||||
var claims Claims
|
||||
err = token.UnsafeClaimsWithoutVerification(&claims)
|
||||
if err != nil {
|
||||
return Claims{}, err
|
||||
}
|
||||
|
||||
return
|
||||
return claims, nil
|
||||
}
|
||||
|
||||
// allowedSignatureAlgorithms is a list of allowed signature algorithms for JWTs.
|
||||
|
Loading…
x
Reference in New Issue
Block a user