Total Complexity | 3 |
Complexity/F | 1 |
Lines of Code | 30 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { Injectable } from "@angular/core"; |
||
2 | import { AngularFireAuth } from "@angular/fire/auth"; |
||
3 | import { Platform } from "@ionic/angular"; |
||
4 | import { auth } from "firebase/app"; |
||
5 | import { AbstractAuth } from "../../providers/abstract-auth"; |
||
6 | import { IAuthProvider } from "../../providers/i-auth-provider"; |
||
7 | |||
8 | @Injectable({ |
||
9 | providedIn: "root", |
||
10 | }) |
||
11 | export class AnonymousAuth extends AbstractAuth implements IAuthProvider { |
||
12 | public readonly providerOptions = {}; |
||
13 | |||
14 | public constructor(angularFireAuth: AngularFireAuth, platform: Platform) { |
||
15 | super(angularFireAuth, platform); |
||
16 | } |
||
17 | |||
18 | public async handleNativeLogin(options: any): Promise<auth.UserCredential> { |
||
19 | return this.handleBrowserLogin(); |
||
20 | } |
||
21 | |||
22 | public async handleBrowserLogin(): Promise<auth.UserCredential> { |
||
23 | return await auth().signInAnonymously(); |
||
24 | } |
||
25 | |||
26 | protected getBrowserLoginProvider(): null { |
||
27 | return null; |
||
28 | } |
||
29 | } |
||
30 |