Merge pull request #307 from jpkrohling/JavascriptCharset
Fixed charset issue while decoding token with atob
This commit is contained in:
commit
911cf2ae45
1 changed files with 1 additions and 1 deletions
|
@ -348,7 +348,7 @@ var Keycloak = function (config) {
|
|||
function setToken(token, refreshToken) {
|
||||
if (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.subject = kc.tokenParsed.sub;
|
||||
kc.realmAccess = kc.tokenParsed.realm_access;
|
||||
|
|
Loading…
Reference in a new issue