Skip to content
New issue

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

IE 11: Invalid calling object #29

Closed
brianleipprandt opened this issue May 13, 2016 · 1 comment
Closed

IE 11: Invalid calling object #29

brianleipprandt opened this issue May 13, 2016 · 1 comment

Comments

@brianleipprandt
Copy link

I'm seeing a 'Invalid calling object' exception in IE 11 when calling jwtDecode with my token. Other browsers seem to all be working.

It looks like this may be related to not binding window.atob in lib/atob.js when the polyfill isn't used.

Stack:

{exception} :
  description: "Invalid calling object",
  message: "Invalid calling object",
  name: "TypeError",
  number: -2147418113,
  stack "TypeError: Invalid calling object\n   at b64DecodeUnicode (eval code:4:3)\n   at module.exports (eval code:29:5)\n   at module.exports (eval code:10:3)\n   at updateAuthToken (eval code:34:3)\n   at auth (eval code:96:7)\n   at combination (eval code:117:7)\n   at dispatch (eval code:179:7)\n   at Anonymous function (eval code:208:13)\n   at Anonymous function (eval code:14:9)\n   at Anonymous function (eval code:140:9)"

Manual checks via debugger in b64DecodeUnicode:

window.atob('test')
"µë-"
atob('test')
Invalid calling object
atob
function atob() { [native code] }
atob === window.atob
True
var bound_atob = window.atob.bind(window);
undefined
bound_atob('test')
"µë-"
@mikecousins
Copy link

mikecousins commented Jul 18, 2016

As a heads-up, I couldn't wait any longer on this being fixed so I forked it and made a new version with this fix in.

https://www.npmjs.com/package/jwt-decode-ie

I think I will deprecate it after this gets fixed here though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants