KEYCLOAK-13940 remove duplicated urlsafe decoding

This commit is contained in:
spurreiter 2020-04-28 14:53:34 +02:00 committed by Stian Thorgersen
parent 44c49d69a7
commit 6332ed42c0

View file

@ -1037,8 +1037,7 @@
str = str.replace('/-/g', '+');
str = str.replace('/_/g', '/');
switch (str.length % 4)
{
switch (str.length % 4) {
case 0:
break;
case 2:
@ -1051,9 +1050,6 @@
throw 'Invalid token';
}
str = (str + '===').slice(0, str.length + (str.length % 4));
str = str.replace(/-/g, '+').replace(/_/g, '/');
str = decodeURIComponent(escape(atob(str)));
str = JSON.parse(str);