Skip to content

Commit 14e354b

Browse files
committed
sign in, sign out kinda work
1 parent 528a735 commit 14e354b

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

generators/client/templates/angular/src/main/webapp/app/layouts/header/header.component.html.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
</ul>
115115
<ul class="usa-nav__secondary-links" *ngIf="isAuthenticated()">
116116
<li class="usa-nav__secondary-item">
117-
<a class="usa-button usa-button--unstyled" (click)="login()">Sign out</a>
117+
<a class="usa-button usa-button--unstyled" (click)="logout()">Sign out</a>
118118
</li>
119119
</ul>
120120
<form class="usa-search usa-search--small ">

generators/client/templates/angular/src/main/webapp/app/layouts/header/header.component.ts.ejs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { SessionStorageService } from 'ngx-webstorage';
88
import { VERSION } from 'app/app.constants';
99
import { <% if (enableTranslation) { %>JhiLanguageHelper, <% } %>AccountService, LoginService } from 'app/core';
1010
import { ProfileService } from 'app/layouts/profiles/profile.service';
11-
import { CookieService } from "ngx-cookie";
1211

1312
@Component({
1413
selector: '<%= jhiPrefixDashed %>-header',
@@ -32,7 +31,6 @@ export class HeaderComponent implements OnInit {
3231
private accountService: AccountService,
3332
private profileService: ProfileService,
3433
private router: Router,
35-
private cookieService: CookieService,
3634
) {
3735
this.version = VERSION ? 'v' + VERSION : '';
3836
}
@@ -58,7 +56,7 @@ export class HeaderComponent implements OnInit {
5856
<%_ } _%>
5957

6058
isAuthenticated() {
61-
return this.cookieService.get('sid');
59+
return this.accountService.isAuthenticated();
6260
}
6361

6462
login() {

0 commit comments

Comments
 (0)