0

I save the response in local storage in console using angular6. Response contain (Id token, access token , JWT token) I want access token for user authentication. How I get this from local storage using angular.Here is the Access Token

amber gautam
  • 107
  • 2
  • 3
  • 9
  • look at this and adjust the line that get the token https://stackoverflow.com/questions/50970446/http-error-handling-in-angular-6/50970853#50970853 – firegloves Jun 22 '18 at 18:49

1 Answers1

1

Let's say u have stored the server response with the key called Token: in the local storage.

var accessTokenObj = JSON.parse(localStorage.getItem("Token:"));
console.log(accessTokenObj);
Hari
  • 1,545
  • 1
  • 22
  • 45