|
|
@@ -1,15 +1,23 @@
|
|
|
<h1>{{title}}</h1>
|
|
|
<router-outlet></router-outlet>
|
|
|
-<button type="button" (click)="login()">Login</button>
|
|
|
-<dl>
|
|
|
- <dt>isLoading</dt>
|
|
|
- <dd>{{ authService.isLoading$ | async | json }}</dd>
|
|
|
- <dt>isAuthenticated</dt>
|
|
|
- <dd>{{ authService.isAuthenticated$ | async | json }}</dd>
|
|
|
- <dt>user</dt>
|
|
|
- <dd>{{ authService.user$ | async | json }}</dd>
|
|
|
- <dt>User Display Name</dt>
|
|
|
- <dd>{{ (authService.user$ | async)?.nickname }}</dd>
|
|
|
- <dt>User ID</dt>
|
|
|
- <dd>{{ (authService.user$ | async)?.sub }}</dd>
|
|
|
-</dl>
|
|
|
+<ng-container *ngIf="!(authService.isLoading$ | async)">
|
|
|
+ <div *ngIf="authService.isAuthenticated$ | async">
|
|
|
+ <dl>
|
|
|
+ <dt>isLoading</dt>
|
|
|
+ <dd>{{ authService.isLoading$ | async | json }}</dd>
|
|
|
+ <dt>isAuthenticated</dt>
|
|
|
+ <dd>{{ authService.isAuthenticated$ | async | json }}</dd>
|
|
|
+ <dt>user</dt>
|
|
|
+ <dd>{{ authService.user$ | async | json }}</dd>
|
|
|
+ <dt>User Display Name</dt>
|
|
|
+ <dd>{{ (authService.user$ | async)?.nickname }}</dd>
|
|
|
+ <dt>User ID</dt>
|
|
|
+ <dd>{{ (authService.user$ | async)?.sub }}</dd>
|
|
|
+ </dl>
|
|
|
+ <button type="button" (click)="logout()">Logout</button>
|
|
|
+ </div>
|
|
|
+ <div *ngIf="!(authService.isAuthenticated$ | async)">
|
|
|
+ Not authenticated
|
|
|
+ <button type="button" (click)="login()">Login</button>
|
|
|
+ </div>
|
|
|
+</ng-container>
|