We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
When I'm trying to decode this token with satellizer:
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJfaWQiOiI1NTUwZTNmNWI2YTRkMGE4MDM5ODkwZTAiLCJmaXJzdE5hbWUiOiJyb2LDqXJ0w6AiLCJsYXN0TmFtZSI6InRow6nDtCIsInJvbGVzIjpbInVzZXIiXSwiZW1haWwiOiJyb2JlcnRhLnRlb0BnbWFpbC5jb20iLCJpYXQiOjE0MzEzNjQ1OTcsImV4cCI6MTQzMjU3NDE5N30.cIWEwWdzbCWIVt98SFpwCEemmAsDffs4NoEIrJpv7Tg
I get this payload:
{ "_id": "5550e3f5b6a4d0a8039890e0", "firstName": "robértà ", "lastName": "théô", "roles": [ "user" ], "email": "[email protected]", "iat": 1431364597, "exp": 1432574197 }
whereas I was expecting the following:
{ "_id": "5550e3f5b6a4d0a8039890e0", "firstName": "robértà", "lastName": "théô", "roles": [ "user" ], "email": "[email protected]", "iat": 1431364597, "exp": 1432574197 }
When looking at angular-jwt lib, they prevent this issue by replacing return JSON.parse($window.atob(base64)); at https://github.com/sahat/satellizer/blob/master/satellizer.js#L298 with return JSON.parse(decodeURIComponent(escape(window.atob(base64)))); at https://github.com/auth0/angular-jwt/blob/master/dist/angular-jwt.js#L75
return JSON.parse($window.atob(base64));
return JSON.parse(decodeURIComponent(escape(window.atob(base64))));
Are you interested in a pull request with this fix if you think it's a good idea?
The text was updated successfully, but these errors were encountered:
Hey @mathpere, sure I'd love a PR for this. It was negligence on my part for not testing inputs using non-english characters.
Sorry, something went wrong.
Merge pull request #405 from TheOneTheOnlyDavidBrown/404_encoding_non…
c265aaf
…_english_characters [#404] encoding non-english characters
Successfully merging a pull request may close this issue.
Hi,
When I'm trying to decode this token with satellizer:
I get this payload:
whereas I was expecting the following:
When looking at angular-jwt lib, they prevent this issue by replacing
return JSON.parse($window.atob(base64));
at https://github.com/sahat/satellizer/blob/master/satellizer.js#L298with
return JSON.parse(decodeURIComponent(escape(window.atob(base64))));
at https://github.com/auth0/angular-jwt/blob/master/dist/angular-jwt.js#L75Are you interested in a pull request with this fix if you think it's a good idea?
The text was updated successfully, but these errors were encountered: