In my Angular SPA, I am able to successfully get the accessToken when a user logs in, but when I refresh the page, I lose the token and the claims. In my Okta options, I have
tokenManager: {session: 'sessionStorage'}
and in my showLogin() method, I have
this.oktaSignIn.tokenManager.add('accessToken', response[1]);
and in my ngOnInit() method, I have
ngOnInit() {
this.oktaSignIn.session.get((response) => {
if (response.status !== 'INACTIVE') {
this.user = response.login;
this.oktaSignIn.tokenManager.get('accessToken');
this.changeDetectorRef.detectChanges();
} else {
this.showLogin();
}
});
}
but still on a page refresh, the claims/accessToken is lost. Is my configuration wrong or is it something completely different?