From 606bcec932d6525ed56495653c7350515b3bfbbf Mon Sep 17 00:00:00 2001 From: William Brawner Date: Wed, 19 Feb 2020 20:19:13 -0700 Subject: [PATCH] Implement logout Signed-off-by: William Brawner --- src/app/app.component.ts | 4 +++- src/app/shared/twigs.http.service.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 0b18b9f..3ad95ae 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -33,7 +33,9 @@ export class AppComponent { } logout(): void { - this.twigsService.logout(); + this.twigsService.logout().subscribe(_ => { + this.location.go('/'); + }); } isLoggedIn() { diff --git a/src/app/shared/twigs.http.service.ts b/src/app/shared/twigs.http.service.ts index 686f934..bc2f19e 100644 --- a/src/app/shared/twigs.http.service.ts +++ b/src/app/shared/twigs.http.service.ts @@ -43,7 +43,7 @@ export class TwigsHttpService implements TwigsService { } logout(): Observable { - return Observable.throw('Not Implemented'); + return this.http.post(this.apiUrl + '/logout', this.options); } // Budgets