auth0-samples / auth0-angular-samples

Auth0 Integration Samples for Angular 2+ Applications
https://auth0.com/docs/quickstart/spa/angular2
MIT License
280 stars 456 forks source link

localAuthSetup() seems not to be working properly #174

Closed martaduch closed 4 years ago

martaduch commented 4 years ago

Hello,

the problem exists in both demo apps 01-Login and 02-Calling-an-API. Login procedure works perfectly fine, after I'm logged in I can see profile page, information about currently logged in user. But when I refresh the page, all I have is a blank page (see screenshot) image the page is white because in home component (src/app/pages/home/home.component.html) we have <div class="container" *ngIf="auth.auth0Client$ | async"> moreover, properly loggedIn is null but in localAuthSetup() it should be setup either to true or false

I use Auth0 hosted page. Login with email and password (no social providers)

How to reproduce:

I used to work with auth0 on react app and there were no such issues. The token is saved to the local storage and from there function checking authorization takes it and do the checks.

martaduch commented 4 years ago

I found a solution in here: https://github.com/auth0/auth0-spa-js/issues/209

stevehobbsdev commented 4 years ago

Glad you found a solution @martajedrecka!