Skip to content

Commit e55d7aa

Browse files
author
Jake Loew
committed
only send request to /me if logged in
1 parent 88fd5b9 commit e55d7aa

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)