Let's say, I make a post request to create my token.
public tokenInfo: TokenInfo;
public login(creds){
return this.http.post<TokenInfo>(this.baseUrl + "Account/CreateToken", creds)
.map(res =>{
this.tokenInfo = res;
return true;
})
}
I get back my token and the expiration date. something like:
{token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ...", expiration: "2017-12-04T03:40:55Z"}
How do I keep it around so that other component can take advantage of it? The first thing that comes to mind is to display the name of the logged user at the left corner of the menu bar and hide the Login item.
Thanks for helping