Skip to content

Commit 250ebc2

Browse files
committed
return an error when the sign method is not supported
1 parent 23c749e commit 250ebc2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

generates/jwt_access.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"strings"
66
"time"
77

8+
errs "errors"
89
"github.com/dgrijalva/jwt-go"
910
"gopkg.in/oauth2.v3"
1011
"gopkg.in/oauth2.v3/errors"
@@ -60,6 +61,8 @@ func (a *JWTAccessGenerate) Token(data *oauth2.GenerateBasic, isGenRefresh bool)
6061
if err != nil {
6162
return "", "", err
6263
}
64+
} else {
65+
return "", "", errs.New("unsupported sign method")
6366
}
6467
access, err = token.SignedString(key)
6568
if err != nil {

0 commit comments

Comments
 (0)