feat(server): add allowed_roles in access_token + refresh_token
This commit is contained in:
parent
307c6f7d15
commit
4afd544c41
|
@ -124,6 +124,7 @@ func CreateRefreshToken(user models.User, roles, scopes []string, hostname, nonc
|
|||
"scope": scopes,
|
||||
"nonce": nonce,
|
||||
"login_method": loginMethod,
|
||||
"allowed_roles": strings.Split(user.Roles, ","),
|
||||
}
|
||||
|
||||
token, err := SignJWTToken(customClaims)
|
||||
|
@ -163,6 +164,7 @@ func CreateAccessToken(user models.User, roles, scopes []string, hostName, nonce
|
|||
"scope": scopes,
|
||||
"roles": roles,
|
||||
"login_method": loginMethod,
|
||||
"allowed_roles": strings.Split(user.Roles, ","),
|
||||
}
|
||||
|
||||
token, err := SignJWTToken(customClaims)
|
||||
|
|
Loading…
Reference in New Issue
Block a user