@@ -9,6 +9,7 @@ import { interval, Subject, forkJoin } from 'rxjs';
9
9
import { tap , switchMap , takeUntil } from 'rxjs/operators' ;
10
10
import { findDocuments } from '../shared/mangoQueries' ;
11
11
import { debug } from '../debug-operator' ;
12
+ import { PouchAuthService } from '../shared/database' ;
12
13
13
14
@Component ( {
14
15
templateUrl : './home.component.html' ,
@@ -48,7 +49,8 @@ export class HomeComponent implements OnInit, AfterViewInit, OnDestroy {
48
49
constructor (
49
50
private couchService : CouchService ,
50
51
private router : Router ,
51
- private userService : UserService
52
+ private userService : UserService ,
53
+ private pouchAuthService : PouchAuthService
52
54
) {
53
55
this . userService . userChange$ . pipe ( takeUntil ( this . onDestroy$ ) )
54
56
. subscribe ( ( ) => {
@@ -116,7 +118,7 @@ export class HomeComponent implements OnInit, AfterViewInit, OnDestroy {
116
118
117
119
logoutClick ( ) {
118
120
this . userService . endSessionLog ( ) . pipe ( switchMap ( ( ) => {
119
- const obsArr = [ this . couchService . delete ( '_session' , { withCredentials : true } ) ] ;
121
+ const obsArr = [ this . pouchAuthService . logout ( ) ] ;
120
122
const localAdminName = this . userService . getConfig ( ) . adminName . split ( '@' ) [ 0 ] ;
121
123
if ( localAdminName === this . userService . get ( ) . name ) {
122
124
obsArr . push (
0 commit comments