You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Upon register we are setting returned authToken into local storage. As returned value is an object but we are not stringifying it, it's being shown as [object Object] in local storage, which is wrong. This means that we won't be able to access any value from it as it's not really an object, but rather a string. Upon trying to parse it, client will "crash" because JSON.parse(localstorage.getItem("token")) can't pase string "[object Object]".
To verify this, run the following code console.log(typeof (localStorage.getItem("token")),localStorage.getItem("token"));. It's output is string [object Object].
To Reproduce
Steps to reproduce the behavior:
Go to 'Register' page as fresh user, or log out from current user and attempt to register again.
Fill out all information and submit your request.
After successful registration, check your local storage in browser for saved "token" value.
Notice that it's a string with value [object Object]
Expected behavior
"token" value should be correctly saved as stringified object and not actual string so it can be later accessed by using JSON.parse() function.
Screenshots
Current code:
Proposed change in upcoming PR:
The text was updated successfully, but these errors were encountered:
Describe the bug
Upon register we are setting returned
authToken
into local storage. As returned value is an object but we are not stringifying it, it's being shown as[object Object]
in local storage, which is wrong. This means that we won't be able to access any value from it as it's not really an object, but rather a string. Upon trying to parse it, client will "crash" becauseJSON.parse(localstorage.getItem("token"))
can't pase string "[object Object]".To verify this, run the following code
console.log(typeof (localStorage.getItem("token")),localStorage.getItem("token"));
. It's output isstring [object Object]
.To Reproduce
Steps to reproduce the behavior:
[object Object]
Expected behavior
"token" value should be correctly saved as stringified object and not actual string so it can be later accessed by using
JSON.parse()
function.Screenshots
Current code:

Proposed change in upcoming PR:

The text was updated successfully, but these errors were encountered: