Commit 0d7b2628 authored by David Hardy's avatar David Hardy

Fixed login service

parent 331baf6d
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {Observable, of} from 'rxjs';
import {map, tap} from 'rxjs/operators';
// import {AngularFireAuth} from '@angular/fire/auth';
import {UserInfo} from 'firebase';
......@@ -24,17 +24,18 @@ export class LoginService {
return this.uidProvider$().pipe(
tap(uid => uid ? console.log(`Logged in, with uid ${uid}`) : console.log('Logged out :(')),
map(uid => uid !== undefined)
// Be sure to import '';'
// Be sure to import 'import {tap, map} from 'rxjs/operators';'
);
}
uidProvider$(): Observable<string> {
return this.auth.authState.pipe(
map(state => state ? state.uid : undefined)
);
// return this.auth.authState.pipe(
// map(state => state ? state.uid : undefined)
// );
return of('OfflineExample');
}
userInfoProvider$(): Observable<UserInfo> {
return this.auth.authState;
}
// userInfoProvider$(): Observable<UserInfo> {
// return this.auth.authState;
// }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment