I've been scouring the internet for help, but can't seem to get anywhere as to why the token in localStorage would be different from the one I get back from the api.
Here's the code:
$auth.login(user).then(function(response) {
$log.info(angular.toJson(response.data.token));
$log.info($localStorage.jwt);
}).catch(function(response) {
// Handle errors here, such as displaying a notification
// for invalid email and/or password.
ToastService.error(response.data.errors);
});
and here's the output:
response.data.token:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEzLCJpc3MiOiJodHRwOlwvXC9sb2NhbGhvc3Q6ODAwMFwvYXV0aFwvbG9naW4iLCJpYXQiOjE0NTMxN
<here starts the difference>
zQzNTIsImV4cCI6MTQ1MzE3Nzk1MiwibmJmIjoxNDUzMTc0MzUyLCJqdGkiOiJhZDc5YzAyYmVjNGI5NWFiODY5Y2NjMmRiMTE0ODQ3NSJ9.7Ru8hubpM8EFyVGw9BchWzHYgg6VYN0sujNiseBJiac"
$localStorage.jwt:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEzLCJpc3MiOiJodHRwOlwvXC9sb2NhbGhvc3Q6ODAwMFwvYXV0aFwvbG9naW4iLCJpYXQiOjE0NTMxN
<here starts the difference>
jM5NzAsImV4cCI6MTQ1MzE2NzU3MCwibmJmIjoxNDUzMTYzOTcwLCJqdGkiOiJmMTgzNGE1YzM2ZmRlNzVmMGM0YzBlYmQzZjMyOTI1ZiJ9.f-AT8PTGC2j9qg_ctQkCYYP5EHJGrxgwQbaPpkhAslQ"
Hello folks!
I've been scouring the internet for help, but can't seem to get anywhere as to why the token in localStorage would be different from the one I get back from the api.
Here's the code:
and here's the output:
Any help would be greatly appreciated.
Cheers!