Fixed charset issue while decoding token with atob
This commit is contained in:
parent
4711dd083f
commit
34fbdf4358
1 changed files with 1 additions and 1 deletions
|
@ -348,7 +348,7 @@ var Keycloak = function (config) {
|
||||||
function setToken(token, refreshToken) {
|
function setToken(token, refreshToken) {
|
||||||
if (token) {
|
if (token) {
|
||||||
kc.token = token;
|
kc.token = token;
|
||||||
kc.tokenParsed = JSON.parse(atob(token.split('.')[1]));
|
kc.tokenParsed = JSON.parse(decodeURIComponent(escape(window.atob( token.split('.')[1] ))));
|
||||||
kc.authenticated = true;
|
kc.authenticated = true;
|
||||||
kc.subject = kc.tokenParsed.sub;
|
kc.subject = kc.tokenParsed.sub;
|
||||||
kc.realmAccess = kc.tokenParsed.realm_access;
|
kc.realmAccess = kc.tokenParsed.realm_access;
|
||||||
|
|
Loading…
Reference in a new issue