Skip to content

Commit 1132575

Browse files
authored
Merge pull request #10 from FusionAuth/9-identify-cause-of-errors-in-quickstart-application
fix issue where user info requests are being sent when not logged in
2 parents 1ebe0e7 + e55d7aa commit 1132575

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

complete-application/src/app/app.component.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ export class AppComponent {
1717

1818
constructor() {
1919
this.isLoggedIn = this.fusionAuthService.isLoggedIn();
20-
this.userInfo$ = fromPromise(this.fusionAuthService.getUserInfo());
21-
22-
this.fusionAuthService.getUserInfo().then(userInfo => {
23-
console.log(userInfo);
24-
})
20+
this.userInfo$ = this.isLoggedIn
21+
? fromPromise(this.fusionAuthService.getUserInfo())
22+
: new Observable<UserInfo>();
2523
}
2624

2725
logout() {

0 commit comments

Comments
 (0)