From 607cb784e6b465ce44f15833c0542b3c998d282f Mon Sep 17 00:00:00 2001 From: Abhishek Gupta Date: Thu, 1 Feb 2018 23:55:46 +0530 Subject: [PATCH] base64url decode jwt --- addon/authenticators/jwt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon/authenticators/jwt.js b/addon/authenticators/jwt.js index 80c8ba0..56030af 100644 --- a/addon/authenticators/jwt.js +++ b/addon/authenticators/jwt.js @@ -281,7 +281,7 @@ export default TokenAuthenticator.extend({ */ getTokenData(token) { const payload = token.split('.')[1]; - const tokenData = decodeURIComponent(window.escape(atob(payload))); + const tokenData = decodeURIComponent(window.atob(payload.replace (/-/g, '+').replace(/_/g, '/'))); try { return JSON.parse(tokenData);