@igo2/auth 1.15.4 → 16.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{esm2020 → esm2022}/igo2-auth.mjs +4 -4
- package/esm2022/lib/auth-form/auth-facebook.component.mjs +67 -0
- package/esm2022/lib/auth-form/auth-form.component.mjs +286 -0
- package/esm2022/lib/auth-form/auth-google.component.mjs +108 -0
- package/esm2022/lib/auth-form/auth-intern.component.mjs +134 -0
- package/esm2022/lib/auth-form/auth-microsoft.component.mjs +107 -0
- package/esm2022/lib/auth-form/auth-microsoftb2c.component.mjs +105 -0
- package/{esm2020 → esm2022}/lib/auth-form/index.mjs +5 -5
- package/{esm2020 → esm2022}/lib/auth-routing.module.mjs +24 -24
- package/{esm2020 → esm2022}/lib/auth.module.mjs +91 -91
- package/esm2022/lib/shared/admin.guard.mjs +39 -0
- package/esm2022/lib/shared/auth-microsoft.provider.mjs +86 -0
- package/esm2022/lib/shared/auth-msalBroadcastServiceb2c.service.mjs +47 -0
- package/esm2022/lib/shared/auth-msalServiceb2c.service..mjs +85 -0
- package/esm2022/lib/shared/auth.guard.mjs +38 -0
- package/esm2022/lib/shared/auth.interceptor.mjs +164 -0
- package/{esm2020 → esm2022}/lib/shared/auth.interface.mjs +2 -2
- package/esm2022/lib/shared/auth.service.mjs +168 -0
- package/esm2022/lib/shared/logged.guard.mjs +38 -0
- package/esm2022/lib/shared/profils.guard.mjs +43 -0
- package/esm2022/lib/shared/protected.directive.mjs +20 -0
- package/{esm2020 → esm2022}/lib/shared/storage.interface.mjs +1 -1
- package/esm2022/lib/shared/storage.service.mjs +99 -0
- package/esm2022/lib/shared/token.service.mjs +48 -0
- package/{esm2020 → esm2022}/public_api.mjs +18 -18
- package/{fesm2020 → fesm2022}/igo2-auth.mjs +1573 -1477
- package/fesm2022/igo2-auth.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/lib/auth-form/auth-facebook.component.d.ts +18 -18
- package/lib/auth-form/auth-form.component.d.ts +42 -42
- package/lib/auth-form/auth-google.component.d.ts +24 -24
- package/lib/auth-form/auth-intern.component.d.ts +21 -21
- package/lib/auth-form/auth-microsoft.component.d.ts +23 -23
- package/lib/auth-form/auth-microsoftb2c.component.d.ts +23 -23
- package/lib/auth-form/index.d.ts +4 -4
- package/lib/auth-routing.module.d.ts +7 -7
- package/lib/auth.module.d.ts +23 -23
- package/lib/shared/admin.guard.d.ts +13 -13
- package/lib/shared/auth-microsoft.provider.d.ts +30 -30
- package/lib/shared/auth-msalBroadcastServiceb2c.service.d.ts +15 -15
- package/lib/shared/auth-msalServiceb2c.service..d.ts +33 -33
- package/lib/shared/auth.guard.d.ts +13 -13
- package/lib/shared/auth.interceptor.d.ts +24 -24
- package/lib/shared/auth.interface.d.ts +99 -99
- package/lib/shared/auth.service.d.ts +44 -44
- package/lib/shared/logged.guard.d.ts +13 -13
- package/lib/shared/profils.guard.d.ts +13 -13
- package/lib/shared/protected.directive.d.ts +8 -8
- package/lib/shared/storage.interface.d.ts +4 -4
- package/lib/shared/storage.service.d.ts +17 -18
- package/lib/shared/token.service.d.ts +15 -15
- package/locale/en.auth.json +28 -0
- package/locale/fr.auth.json +32 -0
- package/package.json +18 -25
- package/public_api.d.ts +15 -15
- package/esm2020/lib/auth-form/auth-facebook.component.mjs +0 -61
- package/esm2020/lib/auth-form/auth-form.component.mjs +0 -277
- package/esm2020/lib/auth-form/auth-google.component.mjs +0 -99
- package/esm2020/lib/auth-form/auth-intern.component.mjs +0 -119
- package/esm2020/lib/auth-form/auth-microsoft.component.mjs +0 -94
- package/esm2020/lib/auth-form/auth-microsoftb2c.component.mjs +0 -93
- package/esm2020/lib/shared/admin.guard.mjs +0 -33
- package/esm2020/lib/shared/auth-microsoft.provider.mjs +0 -84
- package/esm2020/lib/shared/auth-msalBroadcastServiceb2c.service.mjs +0 -38
- package/esm2020/lib/shared/auth-msalServiceb2c.service..mjs +0 -80
- package/esm2020/lib/shared/auth.guard.mjs +0 -32
- package/esm2020/lib/shared/auth.interceptor.mjs +0 -155
- package/esm2020/lib/shared/auth.service.mjs +0 -158
- package/esm2020/lib/shared/logged.guard.mjs +0 -32
- package/esm2020/lib/shared/profils.guard.mjs +0 -37
- package/esm2020/lib/shared/protected.directive.mjs +0 -19
- package/esm2020/lib/shared/storage.service.mjs +0 -91
- package/esm2020/lib/shared/token.service.mjs +0 -47
- package/fesm2015/igo2-auth.mjs +0 -1655
- package/fesm2015/igo2-auth.mjs.map +0 -1
- package/fesm2020/igo2-auth.mjs.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ConfigService } from '@igo2/core';
|
|
3
|
-
import { AuthService } from './auth.service';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class LoggedGuard
|
|
6
|
-
private authService;
|
|
7
|
-
private config;
|
|
8
|
-
private router;
|
|
9
|
-
constructor(authService: AuthService, config: ConfigService, router: Router);
|
|
10
|
-
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LoggedGuard, never>;
|
|
12
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<LoggedGuard>;
|
|
13
|
-
}
|
|
1
|
+
import { Router, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
|
2
|
+
import { ConfigService } from '@igo2/core';
|
|
3
|
+
import { AuthService } from './auth.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class LoggedGuard {
|
|
6
|
+
private authService;
|
|
7
|
+
private config;
|
|
8
|
+
private router;
|
|
9
|
+
constructor(authService: AuthService, config: ConfigService, router: Router);
|
|
10
|
+
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LoggedGuard, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<LoggedGuard>;
|
|
13
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ConfigService } from '@igo2/core';
|
|
3
|
-
import { AuthService } from './auth.service';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class ProfilsGuard
|
|
6
|
-
private authService;
|
|
7
|
-
private config;
|
|
8
|
-
private router;
|
|
9
|
-
constructor(authService: AuthService, config: ConfigService, router: Router);
|
|
10
|
-
canActivate(_route: ActivatedRouteSnapshot, state: RouterStateSnapshot): import("rxjs").Observable<boolean>;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ProfilsGuard, never>;
|
|
12
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ProfilsGuard>;
|
|
13
|
-
}
|
|
1
|
+
import { Router, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
|
2
|
+
import { ConfigService } from '@igo2/core';
|
|
3
|
+
import { AuthService } from './auth.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class ProfilsGuard {
|
|
6
|
+
private authService;
|
|
7
|
+
private config;
|
|
8
|
+
private router;
|
|
9
|
+
constructor(authService: AuthService, config: ConfigService, router: Router);
|
|
10
|
+
canActivate(_route: ActivatedRouteSnapshot, state: RouterStateSnapshot): import("rxjs").Observable<boolean>;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ProfilsGuard, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ProfilsGuard>;
|
|
13
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ElementRef } from '@angular/core';
|
|
2
|
-
import { AuthService } from './auth.service';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ProtectedDirective {
|
|
5
|
-
constructor(authentication: AuthService, el: ElementRef);
|
|
6
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ProtectedDirective, never>;
|
|
7
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ProtectedDirective, "[igoProtected]", never, {}, {}, never, never, false>;
|
|
8
|
-
}
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { AuthService } from './auth.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ProtectedDirective {
|
|
5
|
+
constructor(authentication: AuthService, el: ElementRef);
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ProtectedDirective, never>;
|
|
7
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ProtectedDirective, "[igoProtected]", never, {}, {}, never, never, false, never>;
|
|
8
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StorageOptions } from '@igo2/core';
|
|
2
|
-
export interface AuthStorageOptions extends StorageOptions {
|
|
3
|
-
url: string;
|
|
4
|
-
}
|
|
1
|
+
import { StorageOptions } from '@igo2/core';
|
|
2
|
+
export interface AuthStorageOptions extends StorageOptions {
|
|
3
|
+
url: string;
|
|
4
|
+
}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
|
-
import {
|
|
3
|
-
import { AuthService } from './auth.service';
|
|
4
|
-
import { TokenService } from './token.service';
|
|
5
|
-
import { AuthStorageOptions } from './storage.interface';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class AuthStorageService extends
|
|
8
|
-
private http;
|
|
9
|
-
private authService;
|
|
10
|
-
private tokenService;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
static
|
|
17
|
-
|
|
18
|
-
}
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { StorageScope, ConfigService, BaseStorage } from '@igo2/core';
|
|
3
|
+
import { AuthService } from './auth.service';
|
|
4
|
+
import { TokenService } from './token.service';
|
|
5
|
+
import { AuthStorageOptions } from './storage.interface';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class AuthStorageService extends BaseStorage<AuthStorageOptions> {
|
|
8
|
+
private http;
|
|
9
|
+
private authService;
|
|
10
|
+
private tokenService;
|
|
11
|
+
constructor(config: ConfigService, http: HttpClient, authService: AuthService, tokenService: TokenService);
|
|
12
|
+
set(key: string, value: string | object | boolean | number, scope?: StorageScope): void;
|
|
13
|
+
remove(key: string, scope?: StorageScope): void;
|
|
14
|
+
clear(scope?: StorageScope): void;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuthStorageService, never>;
|
|
16
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AuthStorageService>;
|
|
17
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Injector } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class TokenService {
|
|
4
|
-
private injector;
|
|
5
|
-
private options
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TokenService, never>;
|
|
14
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<TokenService>;
|
|
15
|
-
}
|
|
1
|
+
import { Injector } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class TokenService {
|
|
4
|
+
private injector;
|
|
5
|
+
private options?;
|
|
6
|
+
private tokenKey;
|
|
7
|
+
constructor(injector: Injector);
|
|
8
|
+
set(token: string): void;
|
|
9
|
+
remove(): void;
|
|
10
|
+
get(): string;
|
|
11
|
+
decode(): any;
|
|
12
|
+
isExpired(): boolean;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TokenService, never>;
|
|
14
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TokenService>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"igo": {
|
|
3
|
+
"auth": {
|
|
4
|
+
"accessAnonymous": "Access as anonymous",
|
|
5
|
+
"connection": "Connection",
|
|
6
|
+
"login": "Login",
|
|
7
|
+
"password": "Password",
|
|
8
|
+
"signOut": "Sign out",
|
|
9
|
+
"user": "User",
|
|
10
|
+
"welcome": "Welcome {{name}}!",
|
|
11
|
+
"deconnection": "You are logged out.",
|
|
12
|
+
"home": "Return to the home page",
|
|
13
|
+
"error": {
|
|
14
|
+
"Password expired": "Password expired",
|
|
15
|
+
"Maximun logins exceeded": "Maximum logins exceeded",
|
|
16
|
+
"Login lockout": "Maximum number of attempts exceeded. Your account is locked.",
|
|
17
|
+
"Wrong password": "Wrong password",
|
|
18
|
+
"Invalid username": "Invalid username"
|
|
19
|
+
},
|
|
20
|
+
"microsoft": {
|
|
21
|
+
"login": "Sign in with Azure account"
|
|
22
|
+
},
|
|
23
|
+
"microsoftb2c": {
|
|
24
|
+
"login": "Sign in"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"igo": {
|
|
3
|
+
"auth": {
|
|
4
|
+
"accessAnonymous": "Rester anonyme",
|
|
5
|
+
"connection": "Connexion",
|
|
6
|
+
"login": "Connecter",
|
|
7
|
+
"password": "Mot de passe",
|
|
8
|
+
"signOut": "Se déconnecter",
|
|
9
|
+
"user": "Utilisateur",
|
|
10
|
+
"welcome": "Bienvenue {{name}}!",
|
|
11
|
+
"deconnection": "Vous êtes déconnecté",
|
|
12
|
+
"home": "Retourner à la page d'accueil",
|
|
13
|
+
"error": {
|
|
14
|
+
"Password expired": "Votre mot de passe est expiré",
|
|
15
|
+
"Maximun logins exceeded": "Nombre maximal de connexions dépassé",
|
|
16
|
+
"Login lockout": "Nombre maximal d'essais dépassés. Votre compte est verrouillé.",
|
|
17
|
+
"Wrong password": "Mot de passe incorrect",
|
|
18
|
+
"Invalid username": "Utilisateur invalide"
|
|
19
|
+
},
|
|
20
|
+
"google": {
|
|
21
|
+
"login": "Se connecter avec Google",
|
|
22
|
+
"logged": "Connecté avec Google"
|
|
23
|
+
},
|
|
24
|
+
"microsoft": {
|
|
25
|
+
"login": "Se connecter avec compte Azure"
|
|
26
|
+
},
|
|
27
|
+
"microsoftb2c": {
|
|
28
|
+
"login": "Se connecter"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@igo2/auth",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0-rc.0",
|
|
4
4
|
"description": "IGO Library",
|
|
5
5
|
"author": "IGO Community",
|
|
6
6
|
"keywords": [
|
|
@@ -17,31 +17,26 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"jwt-decode": "^2.2.0",
|
|
20
|
-
"ts-cacheable": "^1.0.
|
|
21
|
-
"ts-md5": "^1.
|
|
22
|
-
"tslib": "^2.
|
|
20
|
+
"ts-cacheable": "^1.0.6",
|
|
21
|
+
"ts-md5": "^1.3.0",
|
|
22
|
+
"tslib": "^2.6.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@angular/cdk": "^
|
|
26
|
-
"@angular/common": "^
|
|
27
|
-
"@angular/core": "^
|
|
28
|
-
"@angular/forms": "^
|
|
29
|
-
"@angular/material": "^
|
|
30
|
-
"@angular/router": "^
|
|
31
|
-
"@igo2/core": "^
|
|
32
|
-
"@igo2/utils": "^
|
|
25
|
+
"@angular/cdk": "^16.2.4",
|
|
26
|
+
"@angular/common": "^16.2.5",
|
|
27
|
+
"@angular/core": "^16.2.5",
|
|
28
|
+
"@angular/forms": "^16.2.5",
|
|
29
|
+
"@angular/material": "^16.2.4",
|
|
30
|
+
"@angular/router": "^16.2.5",
|
|
31
|
+
"@igo2/core": "^16.0.0-rc.0",
|
|
32
|
+
"@igo2/utils": "^16.0.0-rc.0",
|
|
33
33
|
"rxjs": "^7.5.6",
|
|
34
|
-
"@azure/msal-angular": "^
|
|
35
|
-
"@azure/msal-browser": "^2.28.1"
|
|
34
|
+
"@azure/msal-angular": "^3.0.4"
|
|
36
35
|
},
|
|
37
36
|
"engines": {
|
|
38
|
-
"node": ">=
|
|
37
|
+
"node": ">=18.10.0"
|
|
39
38
|
},
|
|
40
|
-
"module": "
|
|
41
|
-
"es2020": "fesm2020/igo2-auth.mjs",
|
|
42
|
-
"esm2020": "esm2020/igo2-auth.mjs",
|
|
43
|
-
"fesm2020": "fesm2020/igo2-auth.mjs",
|
|
44
|
-
"fesm2015": "fesm2015/igo2-auth.mjs",
|
|
39
|
+
"module": "fesm2022/igo2-auth.mjs",
|
|
45
40
|
"typings": "index.d.ts",
|
|
46
41
|
"exports": {
|
|
47
42
|
"./package.json": {
|
|
@@ -49,11 +44,9 @@
|
|
|
49
44
|
},
|
|
50
45
|
".": {
|
|
51
46
|
"types": "./index.d.ts",
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"node": "./fesm2015/igo2-auth.mjs",
|
|
56
|
-
"default": "./fesm2020/igo2-auth.mjs"
|
|
47
|
+
"esm2022": "./esm2022/igo2-auth.mjs",
|
|
48
|
+
"esm": "./esm2022/igo2-auth.mjs",
|
|
49
|
+
"default": "./fesm2022/igo2-auth.mjs"
|
|
57
50
|
}
|
|
58
51
|
},
|
|
59
52
|
"sideEffects": false,
|
package/public_api.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export { AuthFormComponent } from './lib/auth-form';
|
|
2
|
-
export * from './lib/shared/auth.service';
|
|
3
|
-
export * from './lib/shared/logged.guard';
|
|
4
|
-
export * from './lib/shared/auth.guard';
|
|
5
|
-
export * from './lib/shared/admin.guard';
|
|
6
|
-
export * from './lib/shared/profils.guard';
|
|
7
|
-
export * from './lib/shared/auth.interceptor';
|
|
8
|
-
export * from './lib/shared/auth.interface';
|
|
9
|
-
export * from './lib/shared/auth-microsoft.provider';
|
|
10
|
-
export * from './lib/shared/protected.directive';
|
|
11
|
-
export * from './lib/shared/token.service';
|
|
12
|
-
export * from './lib/shared/storage.interface';
|
|
13
|
-
export * from './lib/shared/storage.service';
|
|
14
|
-
export * from './lib/auth-routing.module';
|
|
15
|
-
export * from './lib/auth.module';
|
|
1
|
+
export { AuthFormComponent } from './lib/auth-form';
|
|
2
|
+
export * from './lib/shared/auth.service';
|
|
3
|
+
export * from './lib/shared/logged.guard';
|
|
4
|
+
export * from './lib/shared/auth.guard';
|
|
5
|
+
export * from './lib/shared/admin.guard';
|
|
6
|
+
export * from './lib/shared/profils.guard';
|
|
7
|
+
export * from './lib/shared/auth.interceptor';
|
|
8
|
+
export * from './lib/shared/auth.interface';
|
|
9
|
+
export * from './lib/shared/auth-microsoft.provider';
|
|
10
|
+
export * from './lib/shared/protected.directive';
|
|
11
|
+
export * from './lib/shared/token.service';
|
|
12
|
+
export * from './lib/shared/storage.interface';
|
|
13
|
+
export * from './lib/shared/storage.service';
|
|
14
|
+
export * from './lib/auth-routing.module';
|
|
15
|
+
export * from './lib/auth.module';
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy, Output, EventEmitter } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
import * as i1 from "../shared/auth.service";
|
|
4
|
-
import * as i2 from "@igo2/core";
|
|
5
|
-
export class AuthFacebookComponent {
|
|
6
|
-
constructor(authService, config, appRef) {
|
|
7
|
-
this.authService = authService;
|
|
8
|
-
this.config = config;
|
|
9
|
-
this.appRef = appRef;
|
|
10
|
-
this.login = new EventEmitter();
|
|
11
|
-
this.options = this.config.getConfig('auth.facebook') || {};
|
|
12
|
-
if (this.options.appId) {
|
|
13
|
-
this.loadSDKFacebook();
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
console.warn('Facebook authentification needs "appId" option');
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
subscribeEvents() {
|
|
20
|
-
window.FB.Event.subscribe('auth.statusChange', rep => {
|
|
21
|
-
this.statusChangeCallback(rep);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
statusChangeCallback(response) {
|
|
25
|
-
if (response.status === 'connected') {
|
|
26
|
-
const accessToken = response.authResponse.accessToken;
|
|
27
|
-
this.loginFacebook(accessToken);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
loginFacebook(token) {
|
|
31
|
-
this.authService.loginWithToken(token, 'facebook').subscribe(() => {
|
|
32
|
-
this.appRef.tick();
|
|
33
|
-
this.login.emit(true);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
loadSDKFacebook() {
|
|
37
|
-
if (document.getElementById('facebook-jssdk')) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const urlSDK = 'https://connect.facebook.net/fr_CA/sdk.js#xfbml=1&version=v2.9';
|
|
41
|
-
const fjs = document.getElementsByTagName('script')[0];
|
|
42
|
-
const js = document.createElement('script');
|
|
43
|
-
js.id = 'facebook-jssdk';
|
|
44
|
-
js.src = `${urlSDK}&appId=${this.options.appId}`;
|
|
45
|
-
js.onload = () => {
|
|
46
|
-
this.subscribeEvents();
|
|
47
|
-
};
|
|
48
|
-
fjs.parentNode.insertBefore(js, fjs);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
AuthFacebookComponent.ɵfac = function AuthFacebookComponent_Factory(t) { return new (t || AuthFacebookComponent)(i0.ɵɵdirectiveInject(i1.AuthService), i0.ɵɵdirectiveInject(i2.ConfigService), i0.ɵɵdirectiveInject(i0.ApplicationRef)); };
|
|
52
|
-
AuthFacebookComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AuthFacebookComponent, selectors: [["igo-auth-facebook"]], outputs: { login: "login" }, decls: 1, vars: 0, consts: [["scope", "public_profile,email", "data-max-rows", "1", "data-size", "large", "data-button-type", "login_with", "data-show-faces", "false", "data-auto-logout-link", "false", "data-use-continue-as", "false", 1, "fb-login-button"]], template: function AuthFacebookComponent_Template(rf, ctx) { if (rf & 1) {
|
|
53
|
-
i0.ɵɵelement(0, "div", 0);
|
|
54
|
-
} }, styles: ["[_nghost-%COMP%]{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-3px}"], changeDetection: 0 });
|
|
55
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthFacebookComponent, [{
|
|
56
|
-
type: Component,
|
|
57
|
-
args: [{ selector: 'igo-auth-facebook', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div scope=\"public_profile,email\"\r\n class=\"fb-login-button\" data-max-rows=\"1\" data-size=\"large\"\r\n data-button-type=\"login_with\" data-show-faces=\"false\"\r\n data-auto-logout-link=\"false\" data-use-continue-as=\"false\">\r\n</div>\r\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-3px}\n"] }]
|
|
58
|
-
}], function () { return [{ type: i1.AuthService }, { type: i2.ConfigService }, { type: i0.ApplicationRef }]; }, { login: [{
|
|
59
|
-
type: Output
|
|
60
|
-
}] }); })();
|
|
61
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aC1mYWNlYm9vay5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hdXRoL3NyYy9saWIvYXV0aC1mb3JtL2F1dGgtZmFjZWJvb2suY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYXV0aC9zcmMvbGliL2F1dGgtZm9ybS9hdXRoLWZhY2Vib29rLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxTQUFTLEVBQ1QsdUJBQXVCLEVBRXZCLE1BQU0sRUFDTixZQUFZLEVBQ2IsTUFBTSxlQUFlLENBQU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