I have Integrated kuzzle in ReactJS app using Kuzzle-SDK
Everything works Fine first. I Login using kuzzle.auth.login('local', credentials)
and save the JWT Token in localStorage
and kuzzle.auth.getCurrentUser()
return
{
"profileIds": [
"admin"
],
"_kuzzle_info": {
"author": "usamaashraf82",
"createdAt": 1573960408796,
"updatedAt": null,
"updater": null
}
}
After refreshing the Browser
I try to kuzzle.auth.checkToken();
and it returns {valid: true, expiresAt: 1540824822897 }
and i try to kuzzle.auth.getCurrentUser()
but then its return
{
"profileIds": [
"anonymous"
],
"name": "Anonymous"
}
I want to Ask what I am doing Wrong or How I can solve it