Attempt to fix auth
This commit is contained in:
@@ -21,7 +21,10 @@ export class LogoutComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit(){
|
ngAfterViewInit(){
|
||||||
this.auth.Logout();
|
this.auth.Logout().subscribe({
|
||||||
|
next: data => {
|
||||||
this.router.navigate(["/"]);
|
this.router.navigate(["/"]);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,7 @@ import { CommonModule } from '@angular/common';
|
|||||||
export class PrivacyComponent {
|
export class PrivacyComponent {
|
||||||
|
|
||||||
constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title ) {
|
constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title ) {
|
||||||
this.title.setTitle("Contact | BoredCareers");
|
this.title.setTitle("Privacy | BoredCareers");
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -35,9 +35,9 @@ export class Authentication{
|
|||||||
}
|
}
|
||||||
|
|
||||||
Logout(){
|
Logout(){
|
||||||
this.http.post<Account>( "api/account/logout", {}, { responseType: 'json' } ).subscribe( );
|
|
||||||
this._user.next( new Account );
|
this._user.next( new Account );
|
||||||
this.delUserFromStorage();
|
this.delUserFromStorage();
|
||||||
|
return this.http.post<Account>( "api/account/logout", {}, { responseType: 'json' } );
|
||||||
}
|
}
|
||||||
|
|
||||||
get isLoggedIn(): boolean {
|
get isLoggedIn(): boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user