library JWT DECODE

0

Good morning. I have a problem with the JWT DECODE library, it turns out that I am using it to decode the token that an API sends me to enter my login. When I use it on my local server it works perfectly, but now that I have my project on the test server, it generates these errors when I load the login view:

login.html: 54 GET link net: : ERR_ABORTED

login.html: 1 Slow network is detected. Fallback font will be used while loading: link

login.html: 1 This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see https:

login.html: 54 GET link 404 ( Not Found)

And these errors when I entered the username and password:

[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check

VM153: 1 GET link 404 (Not Found)

Uncaught ReferenceError: jwt_decode is not defined     at Object. (capturelogin.js: 53)     at i (jquery-3.2.1.min.js: 2)     at Object.fireWith [as resolveWith] (jquery-3.2.1.min.js: 2)     at A (jquery-3.2.1.min.js: 4)     at XMLHttpRequest. (jquery-3.2.1.min.js: 4)

and then I really do not understand why. My question is to know if this library only works on local servers or because it is generating these errors in the test server.

I would appreciate if you could help me.

    
asked by YohaBR 21.12.2017 в 15:13
source

1 answer

1

There is very little information and at the same time too much to give you a concrete answer. You have two fundamental errors.

The first, [Deprecation] Synchronous XMLHttpRequest ... , indicates that since the last version of jQuery the use of synchronous XMLHttpRequest has been prohibited (this is used in calls to ajax with async:false ). I have not found anything by jwt-decode about it, so it's possible that it's in your own code (specifically in capturelogin.js:16 ), but I can not say for sure.

The second one indicates that you are making a call to localhost from the remote server, something that you can only explicitly authorize by configuring the CORS. However, I doubt that is what you intended, it is more likely that somewhere in the configuration you have indicated localhost as server for the api.

    
answered by 21.12.2017 / 16:33
source