From 4018da6697711d9c2baa09aadadbf4f3f05d3304 Mon Sep 17 00:00:00 2001 From: Lakhan Samani Date: Tue, 7 Feb 2023 01:13:03 +0530 Subject: [PATCH] [server] use scope string instead of string array in tokens --- server/token/auth_token.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/token/auth_token.go b/server/token/auth_token.go index 32d1085..d2eb454 100644 --- a/server/token/auth_token.go +++ b/server/token/auth_token.go @@ -137,7 +137,7 @@ func CreateRefreshToken(user models.User, roles, scopes []string, hostname, nonc "iat": time.Now().Unix(), "token_type": constants.TokenTypeRefreshToken, "roles": roles, - "scope": scopes, + "scope": strings.Join(scopes, " "), "nonce": nonce, "login_method": loginMethod, "allowed_roles": strings.Split(user.Roles, ","), @@ -177,7 +177,7 @@ func CreateAccessToken(user models.User, roles, scopes []string, hostName, nonce "exp": expiresAt, "iat": time.Now().Unix(), "token_type": constants.TokenTypeAccessToken, - "scope": scopes, + "scope": strings.Join(scopes, " "), "roles": roles, "login_method": loginMethod, "allowed_roles": strings.Split(user.Roles, ","),