I found solution to this one is, im using angular:
this.auth.getAccessTokenSilently().subscribe({
next: (res) => {
console.log('bingo');
},
error: (err) => {
console.log(err);
if (err.error_description == 'Login required') {
this.auth.loginWithRedirect();
}
}
});
Previously i had loginWithRedirect() on one route where redirect uri was passed to route that calls getAccessTokenSilently(), that didnt work. Also cacheLocation: ‘localstorage’ is required for this to work, othere refresh token propertes are not required.
Second solution is to place custom domain in ‘domain’ property inside AuthModule.forRoot. but not like @andrew_heinlein has in his screenshoot or like i did. ‘.us.auth0.com’ should be removed, and only ‘customdomain.com’ (if its .com, if not use different) should be set.