Skip to content

Commit 6b25ec3

Browse files
committed
bug fixing
1 parent c98ae83 commit 6b25ec3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

permissions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var HandlerGetPermissionsByUserID func(userID string) ([]Permission, error)
2323

2424
// IsAuthorized returns error only if the process failed, not if it's not authorized.
2525
func IsAuthorized(w http.ResponseWriter, r *http.Request, metadata *string) (userID string, isAuthorized bool, err error) {
26-
endpointKey := r.Method + r.Pattern
26+
endpointKey := r.Pattern
2727

2828
permissionKey, ok := Permissions[endpointKey]
2929
if !ok {

token.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func VerifyToken(rawToken string, getPublicKeyByUserID func(userID string) (*rsa
5151
return "", ErrNilInsecurePayload
5252
}
5353

54-
insecureUserID := fmt.Sprint(insecurePayload["u"])
54+
insecureUserID := fmt.Sprint(insecurePayload["id"])
5555
if len(insecureUserID) == 0 || len(insecureUserID) > 32 {
5656
return "", ErrInvalidInsecureUserID
5757
}

0 commit comments

Comments
 (0)