Skip to content

Commit b269df6

Browse files
midsorbetpaulbert
authored andcommitted
use pouchdb for signing out user
1 parent cbefda7 commit b269df6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/app/home/home.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { interval, Subject, forkJoin } from 'rxjs';
99
import { tap, switchMap, takeUntil } from 'rxjs/operators';
1010
import { findDocuments } from '../shared/mangoQueries';
1111
import { debug } from '../debug-operator';
12+
import { PouchAuthService } from '../shared/database';
1213

1314
@Component({
1415
templateUrl: './home.component.html',
@@ -48,7 +49,8 @@ export class HomeComponent implements OnInit, AfterViewInit, OnDestroy {
4849
constructor(
4950
private couchService: CouchService,
5051
private router: Router,
51-
private userService: UserService
52+
private userService: UserService,
53+
private pouchAuthService: PouchAuthService
5254
) {
5355
this.userService.userChange$.pipe(takeUntil(this.onDestroy$))
5456
.subscribe(() => {
@@ -116,7 +118,7 @@ export class HomeComponent implements OnInit, AfterViewInit, OnDestroy {
116118

117119
logoutClick() {
118120
this.userService.endSessionLog().pipe(switchMap(() => {
119-
const obsArr = [ this.couchService.delete('_session', { withCredentials: true }) ];
121+
const obsArr = [ this.pouchAuthService.logout() ];
120122
const localAdminName = this.userService.getConfig().adminName.split('@')[0];
121123
if (localAdminName === this.userService.get().name) {
122124
obsArr.push(

0 commit comments

Comments
 (0)