@igo2/auth 1.12.1 → 1.13.0-alpha.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/{esm2015/igo2-auth.js → esm2020/igo2-auth.mjs} +0 -0
- package/{esm2015/lib/auth-form/auth-facebook.component.js → esm2020/lib/auth-form/auth-facebook.component.mjs} +2 -7
- package/esm2020/lib/auth-form/auth-form.component.mjs +277 -0
- package/{esm2015/lib/auth-form/auth-google.component.js → esm2020/lib/auth-form/auth-google.component.mjs} +2 -7
- package/esm2020/lib/auth-form/auth-intern.component.mjs +119 -0
- package/esm2020/lib/auth-form/auth-microsoft.component.mjs +94 -0
- package/esm2020/lib/auth-form/auth-microsoftb2c.component.mjs +93 -0
- package/{esm2015/lib/auth-form/index.js → esm2020/lib/auth-form/index.mjs} +1 -1
- package/{esm2015/lib/auth-routing.module.js → esm2020/lib/auth-routing.module.mjs} +2 -2
- package/{esm2015/lib/auth.module.js → esm2020/lib/auth.module.mjs} +9 -11
- package/{esm2015/lib/shared/admin.guard.js → esm2020/lib/shared/admin.guard.mjs} +1 -1
- package/{esm2015/lib/shared/auth-microsoft.provider.js → esm2020/lib/shared/auth-microsoft.provider.mjs} +1 -1
- package/{esm2015/lib/shared/auth-msalBroadcastServiceb2c.service.js → esm2020/lib/shared/auth-msalBroadcastServiceb2c.service.mjs} +1 -1
- package/esm2020/lib/shared/auth-msalServiceb2c.service..mjs +80 -0
- package/{esm2015/lib/shared/auth.guard.js → esm2020/lib/shared/auth.guard.mjs} +1 -1
- package/{esm2015/lib/shared/auth.interceptor.js → esm2020/lib/shared/auth.interceptor.mjs} +1 -1
- package/esm2020/lib/shared/auth.interface.mjs +2 -0
- package/{esm2015/lib/shared/auth.service.js → esm2020/lib/shared/auth.service.mjs} +1 -1
- package/{esm2015/lib/shared/logged.guard.js → esm2020/lib/shared/logged.guard.mjs} +1 -1
- package/{esm2015/lib/shared/profils.guard.js → esm2020/lib/shared/profils.guard.mjs} +1 -1
- package/{esm2015/lib/shared/protected.directive.js → esm2020/lib/shared/protected.directive.mjs} +1 -1
- package/{esm2015/lib/shared/storage.interface.js → esm2020/lib/shared/storage.interface.mjs} +1 -1
- package/{esm2015/lib/shared/storage.service.js → esm2020/lib/shared/storage.service.mjs} +1 -1
- package/{esm2015/lib/shared/token.service.js → esm2020/lib/shared/token.service.mjs} +1 -1
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +1 -1
- package/fesm2015/igo2-auth.mjs +1655 -0
- package/fesm2015/igo2-auth.mjs.map +1 -0
- package/{fesm2015/igo2-auth.js → fesm2020/igo2-auth.mjs} +215 -254
- package/fesm2020/igo2-auth.mjs.map +1 -0
- package/{igo2-auth.d.ts → index.d.ts} +0 -0
- package/lib/auth-form/auth-facebook.component.d.ts +1 -1
- package/lib/auth-form/auth-form.component.d.ts +1 -1
- package/lib/auth-form/auth-google.component.d.ts +1 -1
- package/lib/auth-form/auth-intern.component.d.ts +4 -4
- package/lib/auth-form/auth-microsoft.component.d.ts +1 -1
- package/lib/auth-form/auth-microsoftb2c.component.d.ts +1 -1
- package/lib/shared/auth-msalServiceb2c.service..d.ts +1 -0
- package/lib/shared/protected.directive.d.ts +1 -1
- package/package.json +27 -14
- package/bundles/igo2-auth.umd.js +0 -2203
- package/bundles/igo2-auth.umd.js.map +0 -1
- package/esm2015/lib/auth-form/auth-form.component.js +0 -286
- package/esm2015/lib/auth-form/auth-intern.component.js +0 -129
- package/esm2015/lib/auth-form/auth-microsoft.component.js +0 -100
- package/esm2015/lib/auth-form/auth-microsoftb2c.component.js +0 -99
- package/esm2015/lib/shared/auth-msalServiceb2c.service..js +0 -77
- package/esm2015/lib/shared/auth.interface.js +0 -2
- package/fesm2015/igo2-auth.js.map +0 -1
package/bundles/igo2-auth.umd.js
DELETED
|
@@ -1,2203 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/router'), require('rxjs/operators'), require('@angular/common/http'), require('rxjs'), require('ts-cacheable'), require('@igo2/utils'), require('jwt-decode'), require('@igo2/core'), require('@angular/common'), require('@azure/msal-angular'), require('@azure/msal-browser'), require('@angular/material/button'), require('@angular/material/icon'), require('@ngx-translate/core'), require('@angular/forms'), require('@angular/material/form-field'), require('@angular/material/input'), require('ts-md5')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@igo2/auth', ['exports', '@angular/core', '@angular/router', 'rxjs/operators', '@angular/common/http', 'rxjs', 'ts-cacheable', '@igo2/utils', 'jwt-decode', '@igo2/core', '@angular/common', '@azure/msal-angular', '@azure/msal-browser', '@angular/material/button', '@angular/material/icon', '@ngx-translate/core', '@angular/forms', '@angular/material/form-field', '@angular/material/input', 'ts-md5'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.igo2 = global.igo2 || {}, global.igo2.auth = {}), global.ng.core, global.ng.router, global.rxjs.operators, global.ng.common.http, global.rxjs, global.tsCacheable, global.utils, global.jwt, global.core, global.ng.common, global["msal-angular"], global["msal-browser"], global.ng.material.button, global.ng.material.icon, global["ngxt-core"], global.ng.forms, global.ng.material.formField, global.ng.material.input, global.tsMd5));
|
|
5
|
-
})(this, (function (exports, i0, i3, operators, i1, rxjs, tsCacheable, utils, jwtDecode, i2, i1$1, i3$1, msalBrowser, i4, i5, i6, i3$2, i4$1, i5$1, tsMd5) { 'use strict';
|
|
6
|
-
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
function _interopNamespace(e) {
|
|
10
|
-
if (e && e.__esModule) return e;
|
|
11
|
-
var n = Object.create(null);
|
|
12
|
-
if (e) {
|
|
13
|
-
Object.keys(e).forEach(function (k) {
|
|
14
|
-
if (k !== 'default') {
|
|
15
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () { return e[k]; }
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
n["default"] = e;
|
|
24
|
-
return Object.freeze(n);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
28
|
-
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
29
|
-
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
30
|
-
var jwtDecode__default = /*#__PURE__*/_interopDefaultLegacy(jwtDecode);
|
|
31
|
-
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
32
|
-
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
33
|
-
var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
|
|
34
|
-
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
35
|
-
var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
|
|
36
|
-
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
37
|
-
var i3__namespace$2 = /*#__PURE__*/_interopNamespace(i3$2);
|
|
38
|
-
var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
|
|
39
|
-
var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
|
|
40
|
-
|
|
41
|
-
var TokenService = /** @class */ (function () {
|
|
42
|
-
function TokenService(injector) {
|
|
43
|
-
this.injector = injector;
|
|
44
|
-
}
|
|
45
|
-
TokenService.prototype.set = function (token) {
|
|
46
|
-
localStorage.setItem(this.tokenKey, token);
|
|
47
|
-
};
|
|
48
|
-
TokenService.prototype.remove = function () {
|
|
49
|
-
localStorage.removeItem(this.tokenKey);
|
|
50
|
-
};
|
|
51
|
-
TokenService.prototype.get = function () {
|
|
52
|
-
return localStorage.getItem(this.tokenKey);
|
|
53
|
-
};
|
|
54
|
-
TokenService.prototype.decode = function () {
|
|
55
|
-
var token = this.get();
|
|
56
|
-
if (!token) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
return jwtDecode__default["default"](token);
|
|
60
|
-
};
|
|
61
|
-
TokenService.prototype.isExpired = function () {
|
|
62
|
-
var jwt = this.decode();
|
|
63
|
-
var currentTime = new Date().getTime() / 1000;
|
|
64
|
-
if (jwt && currentTime < jwt.exp) {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
return true;
|
|
68
|
-
};
|
|
69
|
-
Object.defineProperty(TokenService.prototype, "tokenKey", {
|
|
70
|
-
get: function () {
|
|
71
|
-
var config = this.injector.get(i2.ConfigService);
|
|
72
|
-
this.options = config.getConfig('auth') || {};
|
|
73
|
-
return this.options.tokenKey;
|
|
74
|
-
},
|
|
75
|
-
enumerable: false,
|
|
76
|
-
configurable: true
|
|
77
|
-
});
|
|
78
|
-
return TokenService;
|
|
79
|
-
}());
|
|
80
|
-
TokenService.ɵfac = function TokenService_Factory(t) { return new (t || TokenService)(i0__namespace.ɵɵinject(i0__namespace.Injector)); };
|
|
81
|
-
TokenService.ɵprov = /*@__PURE__*/ i0__namespace.ɵɵdefineInjectable({ token: TokenService, factory: TokenService.ɵfac, providedIn: 'root' });
|
|
82
|
-
(function () {
|
|
83
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(TokenService, [{
|
|
84
|
-
type: i0.Injectable,
|
|
85
|
-
args: [{
|
|
86
|
-
providedIn: 'root'
|
|
87
|
-
}]
|
|
88
|
-
}], function () { return [{ type: i0__namespace.Injector }]; }, null);
|
|
89
|
-
})();
|
|
90
|
-
|
|
91
|
-
var AuthService = /** @class */ (function () {
|
|
92
|
-
function AuthService(http, tokenService, config, languageService, messageService, router) {
|
|
93
|
-
var _this = this;
|
|
94
|
-
this.http = http;
|
|
95
|
-
this.tokenService = tokenService;
|
|
96
|
-
this.config = config;
|
|
97
|
-
this.languageService = languageService;
|
|
98
|
-
this.messageService = messageService;
|
|
99
|
-
this.router = router;
|
|
100
|
-
this.authenticate$ = new rxjs.BehaviorSubject(undefined);
|
|
101
|
-
this.logged$ = new rxjs.BehaviorSubject(undefined);
|
|
102
|
-
this.anonymous = false;
|
|
103
|
-
this.authenticate$.next(this.authenticated);
|
|
104
|
-
this.authenticate$.subscribe(function (authenticated) {
|
|
105
|
-
_this.logged$.next(authenticated);
|
|
106
|
-
tsCacheable.globalCacheBusterNotifier.next();
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
Object.defineProperty(AuthService.prototype, "hasAuthService", {
|
|
110
|
-
get: function () {
|
|
111
|
-
return this.config.getConfig('auth.url') !== undefined;
|
|
112
|
-
},
|
|
113
|
-
enumerable: false,
|
|
114
|
-
configurable: true
|
|
115
|
-
});
|
|
116
|
-
AuthService.prototype.login = function (username, password) {
|
|
117
|
-
var myHeader = new i1.HttpHeaders({ 'Content-Type': 'application/json' });
|
|
118
|
-
var body = {
|
|
119
|
-
username: username,
|
|
120
|
-
password: this.encodePassword(password)
|
|
121
|
-
};
|
|
122
|
-
return this.loginCall(body, myHeader);
|
|
123
|
-
};
|
|
124
|
-
AuthService.prototype.loginWithToken = function (token, type, infosUser) {
|
|
125
|
-
var myHeader = new i1.HttpHeaders({ 'Content-Type': 'application/json' });
|
|
126
|
-
var body = {
|
|
127
|
-
token: token,
|
|
128
|
-
typeConnection: type,
|
|
129
|
-
infosUser: infosUser
|
|
130
|
-
};
|
|
131
|
-
return this.loginCall(body, myHeader);
|
|
132
|
-
};
|
|
133
|
-
AuthService.prototype.loginAnonymous = function () {
|
|
134
|
-
this.anonymous = true;
|
|
135
|
-
this.logged$.next(true);
|
|
136
|
-
return rxjs.of(true);
|
|
137
|
-
};
|
|
138
|
-
AuthService.prototype.refresh = function () {
|
|
139
|
-
var _this = this;
|
|
140
|
-
var url = this.config.getConfig('auth.url');
|
|
141
|
-
return this.http.post(url + "/refresh", {}).pipe(operators.tap(function (data) {
|
|
142
|
-
_this.tokenService.set(data.token);
|
|
143
|
-
}), operators.catchError(function (err) {
|
|
144
|
-
err.error.caught = true;
|
|
145
|
-
throw err;
|
|
146
|
-
}));
|
|
147
|
-
};
|
|
148
|
-
AuthService.prototype.logout = function () {
|
|
149
|
-
this.anonymous = false;
|
|
150
|
-
this.tokenService.remove();
|
|
151
|
-
this.authenticate$.next(false);
|
|
152
|
-
return rxjs.of(true);
|
|
153
|
-
};
|
|
154
|
-
AuthService.prototype.isAuthenticated = function () {
|
|
155
|
-
return !this.tokenService.isExpired();
|
|
156
|
-
};
|
|
157
|
-
AuthService.prototype.getToken = function () {
|
|
158
|
-
return this.tokenService.get();
|
|
159
|
-
};
|
|
160
|
-
AuthService.prototype.decodeToken = function () {
|
|
161
|
-
if (this.isAuthenticated()) {
|
|
162
|
-
return this.tokenService.decode();
|
|
163
|
-
}
|
|
164
|
-
return false;
|
|
165
|
-
};
|
|
166
|
-
AuthService.prototype.goToRedirectUrl = function () {
|
|
167
|
-
if (!this.router) {
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
var redirectUrl = this.redirectUrl || this.router.url;
|
|
171
|
-
var options = this.config.getConfig('auth') || {};
|
|
172
|
-
if (redirectUrl === options.loginRoute) {
|
|
173
|
-
var homeRoute = options.homeRoute || '/';
|
|
174
|
-
this.router.navigateByUrl(homeRoute);
|
|
175
|
-
}
|
|
176
|
-
else if (redirectUrl) {
|
|
177
|
-
this.router.navigateByUrl(redirectUrl);
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
AuthService.prototype.getUserInfo = function () {
|
|
181
|
-
var url = this.config.getConfig('auth.url') + '/info';
|
|
182
|
-
return this.http.get(url);
|
|
183
|
-
};
|
|
184
|
-
AuthService.prototype.getProfils = function () {
|
|
185
|
-
var url = this.config.getConfig('auth.url');
|
|
186
|
-
return this.http.get(url + "/profils");
|
|
187
|
-
};
|
|
188
|
-
AuthService.prototype.updateUser = function (user) {
|
|
189
|
-
var url = this.config.getConfig('auth.url');
|
|
190
|
-
return this.http.patch(url, user);
|
|
191
|
-
};
|
|
192
|
-
AuthService.prototype.encodePassword = function (password) {
|
|
193
|
-
return utils.Base64.encode(password);
|
|
194
|
-
};
|
|
195
|
-
Object.defineProperty(AuthService.prototype, "logged", {
|
|
196
|
-
// authenticated or anonymous
|
|
197
|
-
get: function () {
|
|
198
|
-
return this.authenticated || this.isAnonymous;
|
|
199
|
-
},
|
|
200
|
-
enumerable: false,
|
|
201
|
-
configurable: true
|
|
202
|
-
});
|
|
203
|
-
Object.defineProperty(AuthService.prototype, "isAnonymous", {
|
|
204
|
-
get: function () {
|
|
205
|
-
return this.anonymous;
|
|
206
|
-
},
|
|
207
|
-
enumerable: false,
|
|
208
|
-
configurable: true
|
|
209
|
-
});
|
|
210
|
-
Object.defineProperty(AuthService.prototype, "authenticated", {
|
|
211
|
-
get: function () {
|
|
212
|
-
return this.isAuthenticated();
|
|
213
|
-
},
|
|
214
|
-
enumerable: false,
|
|
215
|
-
configurable: true
|
|
216
|
-
});
|
|
217
|
-
Object.defineProperty(AuthService.prototype, "isAdmin", {
|
|
218
|
-
get: function () {
|
|
219
|
-
var token = this.decodeToken();
|
|
220
|
-
if (token && token.user && token.user.isAdmin) {
|
|
221
|
-
return true;
|
|
222
|
-
}
|
|
223
|
-
return false;
|
|
224
|
-
},
|
|
225
|
-
enumerable: false,
|
|
226
|
-
configurable: true
|
|
227
|
-
});
|
|
228
|
-
AuthService.prototype.loginCall = function (body, headers) {
|
|
229
|
-
var _this = this;
|
|
230
|
-
var url = this.config.getConfig('auth.url');
|
|
231
|
-
return this.http.post(url + "/login", body, { headers: headers }).pipe(operators.tap(function (data) {
|
|
232
|
-
_this.tokenService.set(data.token);
|
|
233
|
-
var tokenDecoded = _this.decodeToken();
|
|
234
|
-
if (tokenDecoded && tokenDecoded.user) {
|
|
235
|
-
if (tokenDecoded.user.locale) {
|
|
236
|
-
_this.languageService.setLanguage(tokenDecoded.user.locale);
|
|
237
|
-
}
|
|
238
|
-
if (tokenDecoded.user.isExpired) {
|
|
239
|
-
_this.languageService.translate
|
|
240
|
-
.get('igo.auth.error.Password expired')
|
|
241
|
-
.subscribe(function (expiredAlert) { return _this.messageService.alert(expiredAlert); });
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
_this.authenticate$.next(true);
|
|
245
|
-
}), operators.catchError(function (err) {
|
|
246
|
-
err.error.caught = true;
|
|
247
|
-
throw err;
|
|
248
|
-
}));
|
|
249
|
-
};
|
|
250
|
-
return AuthService;
|
|
251
|
-
}());
|
|
252
|
-
AuthService.ɵfac = function AuthService_Factory(t) { return new (t || AuthService)(i0__namespace.ɵɵinject(i1__namespace.HttpClient), i0__namespace.ɵɵinject(TokenService), i0__namespace.ɵɵinject(i2__namespace.ConfigService), i0__namespace.ɵɵinject(i2__namespace.LanguageService), i0__namespace.ɵɵinject(i2__namespace.MessageService), i0__namespace.ɵɵinject(i3__namespace.Router, 8)); };
|
|
253
|
-
AuthService.ɵprov = /*@__PURE__*/ i0__namespace.ɵɵdefineInjectable({ token: AuthService, factory: AuthService.ɵfac, providedIn: 'root' });
|
|
254
|
-
(function () {
|
|
255
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(AuthService, [{
|
|
256
|
-
type: i0.Injectable,
|
|
257
|
-
args: [{
|
|
258
|
-
providedIn: 'root'
|
|
259
|
-
}]
|
|
260
|
-
}], function () {
|
|
261
|
-
return [{ type: i1__namespace.HttpClient }, { type: TokenService }, { type: i2__namespace.ConfigService }, { type: i2__namespace.LanguageService }, { type: i2__namespace.MessageService }, { type: i3__namespace.Router, decorators: [{
|
|
262
|
-
type: i0.Optional
|
|
263
|
-
}] }];
|
|
264
|
-
}, null);
|
|
265
|
-
})();
|
|
266
|
-
|
|
267
|
-
var AuthGoogleComponent = /** @class */ (function () {
|
|
268
|
-
function AuthGoogleComponent(authService, config, languageService, appRef) {
|
|
269
|
-
this.authService = authService;
|
|
270
|
-
this.config = config;
|
|
271
|
-
this.languageService = languageService;
|
|
272
|
-
this.appRef = appRef;
|
|
273
|
-
this.login = new i0.EventEmitter();
|
|
274
|
-
this.options = this.config.getConfig('auth.google') || {};
|
|
275
|
-
if (this.options.apiKey && this.options.clientId) {
|
|
276
|
-
this.loadSDKGoogle();
|
|
277
|
-
this.loadPlatform();
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
console.warn('Google authentification needs "apiKey" and "clientId" options');
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
AuthGoogleComponent.prototype.handleSignInClick = function () {
|
|
284
|
-
window.gapi.auth2.getAuthInstance().signIn();
|
|
285
|
-
};
|
|
286
|
-
AuthGoogleComponent.prototype.handleSignOutClick = function () {
|
|
287
|
-
window.gapi.auth2.getAuthInstance().signOut();
|
|
288
|
-
};
|
|
289
|
-
AuthGoogleComponent.prototype.handleClientLoad = function () {
|
|
290
|
-
var _this = this;
|
|
291
|
-
window.gapi.load('client:auth2', function () { return _this.initClient(); });
|
|
292
|
-
};
|
|
293
|
-
AuthGoogleComponent.prototype.initClient = function () {
|
|
294
|
-
var _this = this;
|
|
295
|
-
window.gapi.client
|
|
296
|
-
.init({
|
|
297
|
-
apiKey: this.options.apiKey,
|
|
298
|
-
clientId: this.options.clientId,
|
|
299
|
-
discoveryDocs: [
|
|
300
|
-
'https://people.googleapis.com/$discovery/rest?version=v1'
|
|
301
|
-
],
|
|
302
|
-
scope: 'profile'
|
|
303
|
-
})
|
|
304
|
-
.then(function () {
|
|
305
|
-
_this.handleSignOutClick();
|
|
306
|
-
_this.updateTextButton();
|
|
307
|
-
window.gapi.auth2.getAuthInstance().isSignedIn.listen(function (rep) {
|
|
308
|
-
_this.updateSigninStatus(rep);
|
|
309
|
-
});
|
|
310
|
-
});
|
|
311
|
-
};
|
|
312
|
-
AuthGoogleComponent.prototype.updateSigninStatus = function (isSignedIn) {
|
|
313
|
-
this.updateTextButton();
|
|
314
|
-
if (isSignedIn) {
|
|
315
|
-
this.loginGoogle(window.gapi.client.getToken().access_token);
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
AuthGoogleComponent.prototype.updateTextButton = function () {
|
|
319
|
-
var btn = document.querySelector('span[id^="not_signed_"]');
|
|
320
|
-
if (btn && this.languageService.getLanguage() !== 'en') {
|
|
321
|
-
if (btn.innerHTML === 'Sign in with Google') {
|
|
322
|
-
btn.innerHTML = this.languageService.translate.instant('igo.auth.google.login');
|
|
323
|
-
}
|
|
324
|
-
else if (btn.innerHTML === 'Signed in with Google') {
|
|
325
|
-
btn.innerHTML = this.languageService.translate.instant('igo.auth.google.logged');
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
};
|
|
329
|
-
AuthGoogleComponent.prototype.loginGoogle = function (token) {
|
|
330
|
-
var _this = this;
|
|
331
|
-
this.authService.loginWithToken(token, 'google').subscribe(function () {
|
|
332
|
-
_this.appRef.tick();
|
|
333
|
-
_this.login.emit(true);
|
|
334
|
-
});
|
|
335
|
-
};
|
|
336
|
-
AuthGoogleComponent.prototype.loadSDKGoogle = function () {
|
|
337
|
-
var _this = this;
|
|
338
|
-
var fjs = document.getElementsByTagName('script')[0];
|
|
339
|
-
var js = document.createElement('script');
|
|
340
|
-
js.id = 'google-jssdk';
|
|
341
|
-
js.src = 'https://apis.google.com/js/api.js';
|
|
342
|
-
js.onload = function () {
|
|
343
|
-
_this.handleClientLoad();
|
|
344
|
-
};
|
|
345
|
-
fjs.parentNode.insertBefore(js, fjs);
|
|
346
|
-
};
|
|
347
|
-
AuthGoogleComponent.prototype.loadPlatform = function () {
|
|
348
|
-
var fjs = document.getElementsByTagName('script')[0];
|
|
349
|
-
var js = document.createElement('script');
|
|
350
|
-
js.id = 'google-platform';
|
|
351
|
-
js.src = 'https://apis.google.com/js/platform.js';
|
|
352
|
-
fjs.parentNode.insertBefore(js, fjs);
|
|
353
|
-
};
|
|
354
|
-
return AuthGoogleComponent;
|
|
355
|
-
}());
|
|
356
|
-
AuthGoogleComponent.ɵfac = function AuthGoogleComponent_Factory(t) { return new (t || AuthGoogleComponent)(i0__namespace.ɵɵdirectiveInject(AuthService), i0__namespace.ɵɵdirectiveInject(i2__namespace.ConfigService), i0__namespace.ɵɵdirectiveInject(i2__namespace.LanguageService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ApplicationRef)); };
|
|
357
|
-
AuthGoogleComponent.ɵcmp = /*@__PURE__*/ i0__namespace.ɵɵdefineComponent({ type: AuthGoogleComponent, selectors: [["igo-auth-google"]], outputs: { login: "login" }, decls: 1, vars: 0, consts: [["data-height", "40", "data-width", "265", "data-longtitle", "true", 1, "g-signin2", "google-login-button"]], template: function AuthGoogleComponent_Template(rf, ctx) {
|
|
358
|
-
if (rf & 1) {
|
|
359
|
-
i0__namespace.ɵɵelement(0, "div", 0);
|
|
360
|
-
}
|
|
361
|
-
}, styles: ["[_nghost-%COMP%]{padding:10px 10px 10px 0;display:inline-block}.google-login-button[_ngcontent-%COMP%] .abcRioButton{color:#000000de}"], changeDetection: 0 });
|
|
362
|
-
(function () {
|
|
363
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(AuthGoogleComponent, [{
|
|
364
|
-
type: i0.Component,
|
|
365
|
-
args: [{
|
|
366
|
-
selector: 'igo-auth-google',
|
|
367
|
-
templateUrl: './auth-google.component.html',
|
|
368
|
-
styleUrls: ['./auth-google.component.scss'],
|
|
369
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
370
|
-
}]
|
|
371
|
-
}], function () { return [{ type: AuthService }, { type: i2__namespace.ConfigService }, { type: i2__namespace.LanguageService }, { type: i0__namespace.ApplicationRef }]; }, { login: [{
|
|
372
|
-
type: i0.Output
|
|
373
|
-
}] });
|
|
374
|
-
})();
|
|
375
|
-
|
|
376
|
-
/*! *****************************************************************************
|
|
377
|
-
Copyright (c) Microsoft Corporation.
|
|
378
|
-
|
|
379
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
380
|
-
purpose with or without fee is hereby granted.
|
|
381
|
-
|
|
382
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
383
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
384
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
385
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
386
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
387
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
388
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
389
|
-
***************************************************************************** */
|
|
390
|
-
/* global Reflect, Promise */
|
|
391
|
-
var extendStatics = function (d, b) {
|
|
392
|
-
extendStatics = Object.setPrototypeOf ||
|
|
393
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
394
|
-
function (d, b) { for (var p in b)
|
|
395
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
396
|
-
d[p] = b[p]; };
|
|
397
|
-
return extendStatics(d, b);
|
|
398
|
-
};
|
|
399
|
-
function __extends(d, b) {
|
|
400
|
-
if (typeof b !== "function" && b !== null)
|
|
401
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
402
|
-
extendStatics(d, b);
|
|
403
|
-
function __() { this.constructor = d; }
|
|
404
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
405
|
-
}
|
|
406
|
-
var __assign = function () {
|
|
407
|
-
__assign = Object.assign || function __assign(t) {
|
|
408
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
409
|
-
s = arguments[i];
|
|
410
|
-
for (var p in s)
|
|
411
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
412
|
-
t[p] = s[p];
|
|
413
|
-
}
|
|
414
|
-
return t;
|
|
415
|
-
};
|
|
416
|
-
return __assign.apply(this, arguments);
|
|
417
|
-
};
|
|
418
|
-
function __rest(s, e) {
|
|
419
|
-
var t = {};
|
|
420
|
-
for (var p in s)
|
|
421
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
422
|
-
t[p] = s[p];
|
|
423
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
424
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
425
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
426
|
-
t[p[i]] = s[p[i]];
|
|
427
|
-
}
|
|
428
|
-
return t;
|
|
429
|
-
}
|
|
430
|
-
function __decorate(decorators, target, key, desc) {
|
|
431
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
432
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
433
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
434
|
-
else
|
|
435
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
436
|
-
if (d = decorators[i])
|
|
437
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
438
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
439
|
-
}
|
|
440
|
-
function __param(paramIndex, decorator) {
|
|
441
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
442
|
-
}
|
|
443
|
-
function __metadata(metadataKey, metadataValue) {
|
|
444
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
445
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
446
|
-
}
|
|
447
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
448
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
449
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
450
|
-
function fulfilled(value) { try {
|
|
451
|
-
step(generator.next(value));
|
|
452
|
-
}
|
|
453
|
-
catch (e) {
|
|
454
|
-
reject(e);
|
|
455
|
-
} }
|
|
456
|
-
function rejected(value) { try {
|
|
457
|
-
step(generator["throw"](value));
|
|
458
|
-
}
|
|
459
|
-
catch (e) {
|
|
460
|
-
reject(e);
|
|
461
|
-
} }
|
|
462
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
463
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
|
-
function __generator(thisArg, body) {
|
|
467
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
468
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
469
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
470
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
471
|
-
function step(op) {
|
|
472
|
-
if (f)
|
|
473
|
-
throw new TypeError("Generator is already executing.");
|
|
474
|
-
while (_)
|
|
475
|
-
try {
|
|
476
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
477
|
-
return t;
|
|
478
|
-
if (y = 0, t)
|
|
479
|
-
op = [op[0] & 2, t.value];
|
|
480
|
-
switch (op[0]) {
|
|
481
|
-
case 0:
|
|
482
|
-
case 1:
|
|
483
|
-
t = op;
|
|
484
|
-
break;
|
|
485
|
-
case 4:
|
|
486
|
-
_.label++;
|
|
487
|
-
return { value: op[1], done: false };
|
|
488
|
-
case 5:
|
|
489
|
-
_.label++;
|
|
490
|
-
y = op[1];
|
|
491
|
-
op = [0];
|
|
492
|
-
continue;
|
|
493
|
-
case 7:
|
|
494
|
-
op = _.ops.pop();
|
|
495
|
-
_.trys.pop();
|
|
496
|
-
continue;
|
|
497
|
-
default:
|
|
498
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
499
|
-
_ = 0;
|
|
500
|
-
continue;
|
|
501
|
-
}
|
|
502
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
503
|
-
_.label = op[1];
|
|
504
|
-
break;
|
|
505
|
-
}
|
|
506
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
507
|
-
_.label = t[1];
|
|
508
|
-
t = op;
|
|
509
|
-
break;
|
|
510
|
-
}
|
|
511
|
-
if (t && _.label < t[2]) {
|
|
512
|
-
_.label = t[2];
|
|
513
|
-
_.ops.push(op);
|
|
514
|
-
break;
|
|
515
|
-
}
|
|
516
|
-
if (t[2])
|
|
517
|
-
_.ops.pop();
|
|
518
|
-
_.trys.pop();
|
|
519
|
-
continue;
|
|
520
|
-
}
|
|
521
|
-
op = body.call(thisArg, _);
|
|
522
|
-
}
|
|
523
|
-
catch (e) {
|
|
524
|
-
op = [6, e];
|
|
525
|
-
y = 0;
|
|
526
|
-
}
|
|
527
|
-
finally {
|
|
528
|
-
f = t = 0;
|
|
529
|
-
}
|
|
530
|
-
if (op[0] & 5)
|
|
531
|
-
throw op[1];
|
|
532
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
536
|
-
if (k2 === undefined)
|
|
537
|
-
k2 = k;
|
|
538
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
539
|
-
}) : (function (o, m, k, k2) {
|
|
540
|
-
if (k2 === undefined)
|
|
541
|
-
k2 = k;
|
|
542
|
-
o[k2] = m[k];
|
|
543
|
-
});
|
|
544
|
-
function __exportStar(m, o) {
|
|
545
|
-
for (var p in m)
|
|
546
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
547
|
-
__createBinding(o, m, p);
|
|
548
|
-
}
|
|
549
|
-
function __values(o) {
|
|
550
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
551
|
-
if (m)
|
|
552
|
-
return m.call(o);
|
|
553
|
-
if (o && typeof o.length === "number")
|
|
554
|
-
return {
|
|
555
|
-
next: function () {
|
|
556
|
-
if (o && i >= o.length)
|
|
557
|
-
o = void 0;
|
|
558
|
-
return { value: o && o[i++], done: !o };
|
|
559
|
-
}
|
|
560
|
-
};
|
|
561
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
562
|
-
}
|
|
563
|
-
function __read(o, n) {
|
|
564
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
565
|
-
if (!m)
|
|
566
|
-
return o;
|
|
567
|
-
var i = m.call(o), r, ar = [], e;
|
|
568
|
-
try {
|
|
569
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
570
|
-
ar.push(r.value);
|
|
571
|
-
}
|
|
572
|
-
catch (error) {
|
|
573
|
-
e = { error: error };
|
|
574
|
-
}
|
|
575
|
-
finally {
|
|
576
|
-
try {
|
|
577
|
-
if (r && !r.done && (m = i["return"]))
|
|
578
|
-
m.call(i);
|
|
579
|
-
}
|
|
580
|
-
finally {
|
|
581
|
-
if (e)
|
|
582
|
-
throw e.error;
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
return ar;
|
|
586
|
-
}
|
|
587
|
-
/** @deprecated */
|
|
588
|
-
function __spread() {
|
|
589
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
590
|
-
ar = ar.concat(__read(arguments[i]));
|
|
591
|
-
return ar;
|
|
592
|
-
}
|
|
593
|
-
/** @deprecated */
|
|
594
|
-
function __spreadArrays() {
|
|
595
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
596
|
-
s += arguments[i].length;
|
|
597
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
598
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
599
|
-
r[k] = a[j];
|
|
600
|
-
return r;
|
|
601
|
-
}
|
|
602
|
-
function __spreadArray(to, from, pack) {
|
|
603
|
-
if (pack || arguments.length === 2)
|
|
604
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
605
|
-
if (ar || !(i in from)) {
|
|
606
|
-
if (!ar)
|
|
607
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
608
|
-
ar[i] = from[i];
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
612
|
-
}
|
|
613
|
-
function __await(v) {
|
|
614
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
615
|
-
}
|
|
616
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
617
|
-
if (!Symbol.asyncIterator)
|
|
618
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
619
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
620
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
621
|
-
function verb(n) { if (g[n])
|
|
622
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
623
|
-
function resume(n, v) { try {
|
|
624
|
-
step(g[n](v));
|
|
625
|
-
}
|
|
626
|
-
catch (e) {
|
|
627
|
-
settle(q[0][3], e);
|
|
628
|
-
} }
|
|
629
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
630
|
-
function fulfill(value) { resume("next", value); }
|
|
631
|
-
function reject(value) { resume("throw", value); }
|
|
632
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
633
|
-
resume(q[0][0], q[0][1]); }
|
|
634
|
-
}
|
|
635
|
-
function __asyncDelegator(o) {
|
|
636
|
-
var i, p;
|
|
637
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
638
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
639
|
-
}
|
|
640
|
-
function __asyncValues(o) {
|
|
641
|
-
if (!Symbol.asyncIterator)
|
|
642
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
643
|
-
var m = o[Symbol.asyncIterator], i;
|
|
644
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
645
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
646
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
647
|
-
}
|
|
648
|
-
function __makeTemplateObject(cooked, raw) {
|
|
649
|
-
if (Object.defineProperty) {
|
|
650
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
651
|
-
}
|
|
652
|
-
else {
|
|
653
|
-
cooked.raw = raw;
|
|
654
|
-
}
|
|
655
|
-
return cooked;
|
|
656
|
-
}
|
|
657
|
-
;
|
|
658
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
659
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
660
|
-
}) : function (o, v) {
|
|
661
|
-
o["default"] = v;
|
|
662
|
-
};
|
|
663
|
-
function __importStar(mod) {
|
|
664
|
-
if (mod && mod.__esModule)
|
|
665
|
-
return mod;
|
|
666
|
-
var result = {};
|
|
667
|
-
if (mod != null)
|
|
668
|
-
for (var k in mod)
|
|
669
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
670
|
-
__createBinding(result, mod, k);
|
|
671
|
-
__setModuleDefault(result, mod);
|
|
672
|
-
return result;
|
|
673
|
-
}
|
|
674
|
-
function __importDefault(mod) {
|
|
675
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
676
|
-
}
|
|
677
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
678
|
-
if (kind === "a" && !f)
|
|
679
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
680
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
681
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
682
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
683
|
-
}
|
|
684
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
685
|
-
if (kind === "m")
|
|
686
|
-
throw new TypeError("Private method is not writable");
|
|
687
|
-
if (kind === "a" && !f)
|
|
688
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
689
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
690
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
691
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
var AuthMicrosoftComponent = /** @class */ (function () {
|
|
695
|
-
function AuthMicrosoftComponent(authService, config, appRef, msalService, msalGuardConfig) {
|
|
696
|
-
var _this = this;
|
|
697
|
-
this.authService = authService;
|
|
698
|
-
this.config = config;
|
|
699
|
-
this.appRef = appRef;
|
|
700
|
-
this.msalService = msalService;
|
|
701
|
-
this.msalGuardConfig = msalGuardConfig;
|
|
702
|
-
this._destroying$ = new rxjs.Subject();
|
|
703
|
-
this.login = new i0.EventEmitter();
|
|
704
|
-
this.options = this.config.getConfig('auth.microsoft') || {};
|
|
705
|
-
this.msalService.instance = new msalBrowser.PublicClientApplication({
|
|
706
|
-
auth: this.options,
|
|
707
|
-
cache: {
|
|
708
|
-
cacheLocation: 'sessionStorage'
|
|
709
|
-
}
|
|
710
|
-
});
|
|
711
|
-
this.broadcastService = new i3$1.MsalBroadcastService(this.msalService.instance, this.msalService);
|
|
712
|
-
if (this.options.clientId) {
|
|
713
|
-
this.broadcastService.inProgress$
|
|
714
|
-
.pipe(operators.filter(function (status) { return status === msalBrowser.InteractionStatus.None; }), operators.takeUntil(this._destroying$))
|
|
715
|
-
.subscribe(function () {
|
|
716
|
-
_this.checkAccount();
|
|
717
|
-
});
|
|
718
|
-
}
|
|
719
|
-
else {
|
|
720
|
-
console.warn('Microsoft authentification needs "clientId" option');
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
AuthMicrosoftComponent.prototype.loginMicrosoft = function () {
|
|
724
|
-
var _this = this;
|
|
725
|
-
this.msalService.loginPopup(Object.assign({}, this.getConf().authRequest))
|
|
726
|
-
.subscribe(function (response) {
|
|
727
|
-
_this.msalService.instance.setActiveAccount(response.account);
|
|
728
|
-
_this.checkAccount();
|
|
729
|
-
});
|
|
730
|
-
};
|
|
731
|
-
AuthMicrosoftComponent.prototype.checkAccount = function () {
|
|
732
|
-
var _this = this;
|
|
733
|
-
this.msalService.instance
|
|
734
|
-
.acquireTokenSilent(this.getConf().authRequest)
|
|
735
|
-
.then(function (response) {
|
|
736
|
-
var tokenAccess = response.accessToken;
|
|
737
|
-
var tokenId = response.idToken;
|
|
738
|
-
_this.authService.loginWithToken(tokenAccess, 'microsoft', { tokenId: tokenId }).subscribe(function () {
|
|
739
|
-
_this.appRef.tick();
|
|
740
|
-
_this.login.emit(true);
|
|
741
|
-
});
|
|
742
|
-
})
|
|
743
|
-
.catch(function (error) { return __awaiter(_this, void 0, void 0, function () {
|
|
744
|
-
return __generator(this, function (_a) {
|
|
745
|
-
if (error instanceof msalBrowser.InteractionRequiredAuthError) {
|
|
746
|
-
// fallback to interaction when silent call fails
|
|
747
|
-
return [2 /*return*/, this.msalService.acquireTokenPopup(this.getConf().authRequest)];
|
|
748
|
-
}
|
|
749
|
-
console.log(error);
|
|
750
|
-
return [2 /*return*/];
|
|
751
|
-
});
|
|
752
|
-
}); }).catch(function (error) {
|
|
753
|
-
console.log('Silent token fails');
|
|
754
|
-
});
|
|
755
|
-
};
|
|
756
|
-
AuthMicrosoftComponent.prototype.getConf = function () {
|
|
757
|
-
return this.msalGuardConfig.filter(function (conf) { return conf.type === 'add'; })[0];
|
|
758
|
-
};
|
|
759
|
-
return AuthMicrosoftComponent;
|
|
760
|
-
}());
|
|
761
|
-
AuthMicrosoftComponent.ɵfac = function AuthMicrosoftComponent_Factory(t) { return new (t || AuthMicrosoftComponent)(i0__namespace.ɵɵdirectiveInject(AuthService), i0__namespace.ɵɵdirectiveInject(i2__namespace.ConfigService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ApplicationRef), i0__namespace.ɵɵdirectiveInject(i3__namespace$1.MsalService), i0__namespace.ɵɵdirectiveInject(i3$1.MSAL_GUARD_CONFIG)); };
|
|
762
|
-
AuthMicrosoftComponent.ɵcmp = /*@__PURE__*/ i0__namespace.ɵɵdefineComponent({ type: AuthMicrosoftComponent, selectors: [["igo-auth-microsoft"]], outputs: { login: "login" }, decls: 4, vars: 3, consts: [["mat-raised-button", "", 1, "microsoft-login-button", 3, "click"], ["svgIcon", "microsoft"]], template: function AuthMicrosoftComponent_Template(rf, ctx) {
|
|
763
|
-
if (rf & 1) {
|
|
764
|
-
i0__namespace.ɵɵelementStart(0, "button", 0);
|
|
765
|
-
i0__namespace.ɵɵlistener("click", function AuthMicrosoftComponent_Template_button_click_0_listener() { return ctx.loginMicrosoft(); });
|
|
766
|
-
i0__namespace.ɵɵelement(1, "mat-icon", 1);
|
|
767
|
-
i0__namespace.ɵɵtext(2);
|
|
768
|
-
i0__namespace.ɵɵpipe(3, "translate");
|
|
769
|
-
i0__namespace.ɵɵelementEnd();
|
|
770
|
-
}
|
|
771
|
-
if (rf & 2) {
|
|
772
|
-
i0__namespace.ɵɵadvance(2);
|
|
773
|
-
i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(3, 1, "igo.auth.microsoft.login"), "\n");
|
|
774
|
-
}
|
|
775
|
-
}, directives: [i4__namespace.MatButton, i5__namespace.MatIcon], pipes: [i6__namespace.TranslatePipe], styles: ["[_nghost-%COMP%]{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}[_nghost-%COMP%] > button[_ngcontent-%COMP%]{font-size:15px;height:40px;width:265px}mat-icon[_ngcontent-%COMP%]{margin-right:10px}"], changeDetection: 0 });
|
|
776
|
-
(function () {
|
|
777
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(AuthMicrosoftComponent, [{
|
|
778
|
-
type: i0.Component,
|
|
779
|
-
args: [{
|
|
780
|
-
selector: 'igo-auth-microsoft',
|
|
781
|
-
templateUrl: './auth-microsoft.component.html',
|
|
782
|
-
styleUrls: ['./auth-microsoft.component.scss'],
|
|
783
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
784
|
-
}]
|
|
785
|
-
}], function () {
|
|
786
|
-
return [{ type: AuthService }, { type: i2__namespace.ConfigService }, { type: i0__namespace.ApplicationRef }, { type: i3__namespace$1.MsalService }, { type: undefined, decorators: [{
|
|
787
|
-
type: i0.Inject,
|
|
788
|
-
args: [i3$1.MSAL_GUARD_CONFIG]
|
|
789
|
-
}] }];
|
|
790
|
-
}, { login: [{
|
|
791
|
-
type: i0.Output
|
|
792
|
-
}] });
|
|
793
|
-
})();
|
|
794
|
-
|
|
795
|
-
/*
|
|
796
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
797
|
-
* Licensed under the MIT License.
|
|
798
|
-
*/
|
|
799
|
-
var MsalServiceb2c = /** @class */ (function () {
|
|
800
|
-
function MsalServiceb2c(instance, location) {
|
|
801
|
-
this.instance = instance;
|
|
802
|
-
this.location = location;
|
|
803
|
-
this.name = '@azure/msal-angular';
|
|
804
|
-
this.version = '2.0.0-beta.2';
|
|
805
|
-
var hash = this.location.path(true).split('#').pop();
|
|
806
|
-
if (hash) {
|
|
807
|
-
this.redirectHash = "#" + hash;
|
|
808
|
-
}
|
|
809
|
-
this.instance.initializeWrapperLibrary(msalBrowser.WrapperSKU.Angular, this.version);
|
|
810
|
-
}
|
|
811
|
-
MsalServiceb2c.prototype.acquireTokenPopup = function (request) {
|
|
812
|
-
return rxjs.from(this.instance.acquireTokenPopup(request));
|
|
813
|
-
};
|
|
814
|
-
MsalServiceb2c.prototype.acquireTokenRedirect = function (request) {
|
|
815
|
-
return rxjs.from(this.instance.acquireTokenRedirect(request));
|
|
816
|
-
};
|
|
817
|
-
MsalServiceb2c.prototype.acquireTokenSilent = function (silentRequest) {
|
|
818
|
-
return rxjs.from(this.instance.acquireTokenSilent(silentRequest));
|
|
819
|
-
};
|
|
820
|
-
MsalServiceb2c.prototype.handleRedirectObservable = function (hash) {
|
|
821
|
-
return rxjs.from(this.instance.handleRedirectPromise(hash || this.redirectHash));
|
|
822
|
-
};
|
|
823
|
-
MsalServiceb2c.prototype.loginPopup = function (request) {
|
|
824
|
-
return rxjs.from(this.instance.loginPopup(request));
|
|
825
|
-
};
|
|
826
|
-
MsalServiceb2c.prototype.loginRedirect = function (request) {
|
|
827
|
-
return rxjs.from(this.instance.loginRedirect(request));
|
|
828
|
-
};
|
|
829
|
-
MsalServiceb2c.prototype.logout = function (logoutRequest) {
|
|
830
|
-
return rxjs.from(this.instance.logout(logoutRequest));
|
|
831
|
-
};
|
|
832
|
-
MsalServiceb2c.prototype.logoutRedirect = function (logoutRequest) {
|
|
833
|
-
return rxjs.from(this.instance.logoutRedirect(logoutRequest));
|
|
834
|
-
};
|
|
835
|
-
MsalServiceb2c.prototype.logoutPopup = function (logoutRequest) {
|
|
836
|
-
return rxjs.from(this.instance.logoutPopup(logoutRequest));
|
|
837
|
-
};
|
|
838
|
-
MsalServiceb2c.prototype.ssoSilent = function (request) {
|
|
839
|
-
return rxjs.from(this.instance.ssoSilent(request));
|
|
840
|
-
};
|
|
841
|
-
/**
|
|
842
|
-
* Gets logger for msal-angular.
|
|
843
|
-
* If no logger set, returns logger instance created with same options as msal-browser
|
|
844
|
-
*/
|
|
845
|
-
MsalServiceb2c.prototype.getLogger = function () {
|
|
846
|
-
if (!this.logger) {
|
|
847
|
-
this.logger = this.instance.getLogger().clone(this.name, this.version);
|
|
848
|
-
}
|
|
849
|
-
return this.logger;
|
|
850
|
-
};
|
|
851
|
-
// Create a logger instance for msal-angular with the same options as msal-browser
|
|
852
|
-
MsalServiceb2c.prototype.setLogger = function (logger) {
|
|
853
|
-
this.logger = logger.clone(this.name, this.version);
|
|
854
|
-
this.instance.setLogger(logger);
|
|
855
|
-
};
|
|
856
|
-
return MsalServiceb2c;
|
|
857
|
-
}());
|
|
858
|
-
MsalServiceb2c.ɵfac = function MsalServiceb2c_Factory(t) { return new (t || MsalServiceb2c)(i0__namespace.ɵɵinject(i3$1.MSAL_INSTANCE), i0__namespace.ɵɵinject(i1__namespace$1.Location)); };
|
|
859
|
-
MsalServiceb2c.ɵprov = /*@__PURE__*/ i0__namespace.ɵɵdefineInjectable({ token: MsalServiceb2c, factory: MsalServiceb2c.ɵfac });
|
|
860
|
-
(function () {
|
|
861
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(MsalServiceb2c, [{
|
|
862
|
-
type: i0.Injectable
|
|
863
|
-
}], function () {
|
|
864
|
-
return [{ type: undefined, decorators: [{
|
|
865
|
-
type: i0.Inject,
|
|
866
|
-
args: [i3$1.MSAL_INSTANCE]
|
|
867
|
-
}] }, { type: i1__namespace$1.Location }];
|
|
868
|
-
}, null);
|
|
869
|
-
})();
|
|
870
|
-
|
|
871
|
-
/*
|
|
872
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
873
|
-
* Licensed under the MIT License.
|
|
874
|
-
*/
|
|
875
|
-
var MsalBroadcastServiceb2c = /** @class */ (function () {
|
|
876
|
-
function MsalBroadcastServiceb2c(msalInstance, authService) {
|
|
877
|
-
var _this = this;
|
|
878
|
-
this.msalInstance = msalInstance;
|
|
879
|
-
this.authService = authService;
|
|
880
|
-
this._msalSubject = new rxjs.Subject();
|
|
881
|
-
this.msalSubject$ = this._msalSubject.asObservable();
|
|
882
|
-
// InProgress as BehaviorSubject so most recent inProgress state will be available upon subscription
|
|
883
|
-
this._inProgress = new rxjs.BehaviorSubject(msalBrowser.InteractionStatus.Startup);
|
|
884
|
-
this.inProgress$ = this._inProgress.asObservable();
|
|
885
|
-
this.msalInstance.addEventCallback(function (message) {
|
|
886
|
-
_this._msalSubject.next(message);
|
|
887
|
-
var status = msalBrowser.EventMessageUtils.getInteractionStatusFromEvent(message);
|
|
888
|
-
if (status !== null) {
|
|
889
|
-
_this.authService.getLogger().verbose("BroadcastService - " + message.eventType + " results in setting inProgress to " + status);
|
|
890
|
-
_this._inProgress.next(status);
|
|
891
|
-
}
|
|
892
|
-
});
|
|
893
|
-
}
|
|
894
|
-
return MsalBroadcastServiceb2c;
|
|
895
|
-
}());
|
|
896
|
-
MsalBroadcastServiceb2c.ɵfac = function MsalBroadcastServiceb2c_Factory(t) { return new (t || MsalBroadcastServiceb2c)(i0__namespace.ɵɵinject(i3$1.MSAL_INSTANCE), i0__namespace.ɵɵinject(MsalServiceb2c)); };
|
|
897
|
-
MsalBroadcastServiceb2c.ɵprov = /*@__PURE__*/ i0__namespace.ɵɵdefineInjectable({ token: MsalBroadcastServiceb2c, factory: MsalBroadcastServiceb2c.ɵfac });
|
|
898
|
-
(function () {
|
|
899
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(MsalBroadcastServiceb2c, [{
|
|
900
|
-
type: i0.Injectable
|
|
901
|
-
}], function () {
|
|
902
|
-
return [{ type: undefined, decorators: [{
|
|
903
|
-
type: i0.Inject,
|
|
904
|
-
args: [i3$1.MSAL_INSTANCE]
|
|
905
|
-
}] }, { type: MsalServiceb2c }];
|
|
906
|
-
}, null);
|
|
907
|
-
})();
|
|
908
|
-
|
|
909
|
-
var AuthMicrosoftb2cComponent = /** @class */ (function () {
|
|
910
|
-
function AuthMicrosoftb2cComponent(authService, config, appRef, msalService, msalGuardConfig) {
|
|
911
|
-
var _this = this;
|
|
912
|
-
this.authService = authService;
|
|
913
|
-
this.config = config;
|
|
914
|
-
this.appRef = appRef;
|
|
915
|
-
this.msalService = msalService;
|
|
916
|
-
this.msalGuardConfig = msalGuardConfig;
|
|
917
|
-
this._destroying$ = new rxjs.Subject();
|
|
918
|
-
this.login = new i0.EventEmitter();
|
|
919
|
-
this.options = this.config.getConfig('auth.microsoftb2c') || {};
|
|
920
|
-
this.msalService.instance = new msalBrowser.PublicClientApplication({
|
|
921
|
-
auth: this.options.browserAuthOptions,
|
|
922
|
-
cache: {
|
|
923
|
-
cacheLocation: 'sessionStorage'
|
|
924
|
-
}
|
|
925
|
-
});
|
|
926
|
-
this.broadcastService = new MsalBroadcastServiceb2c(this.msalService.instance, this.msalService);
|
|
927
|
-
if (this.options.browserAuthOptions.clientId) {
|
|
928
|
-
this.broadcastService.inProgress$
|
|
929
|
-
.pipe(operators.filter(function (status) { return status === msalBrowser.InteractionStatus.None; }), operators.takeUntil(this._destroying$))
|
|
930
|
-
.subscribe(function () {
|
|
931
|
-
_this.checkAccount();
|
|
932
|
-
});
|
|
933
|
-
}
|
|
934
|
-
else {
|
|
935
|
-
console.warn('Microsoft authentification needs "clientId" option');
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
AuthMicrosoftb2cComponent.prototype.loginMicrosoftb2c = function () {
|
|
939
|
-
var _this = this;
|
|
940
|
-
this.msalService.loginPopup(Object.assign({}, this.getConf().authRequest))
|
|
941
|
-
.subscribe(function (response) {
|
|
942
|
-
_this.msalService.instance.setActiveAccount(response.account);
|
|
943
|
-
_this.checkAccount();
|
|
944
|
-
});
|
|
945
|
-
};
|
|
946
|
-
AuthMicrosoftb2cComponent.prototype.checkAccount = function () {
|
|
947
|
-
var _this = this;
|
|
948
|
-
this.msalService.instance
|
|
949
|
-
.acquireTokenSilent(this.getConf().authRequest)
|
|
950
|
-
.then(function (response) {
|
|
951
|
-
var token = response.idToken;
|
|
952
|
-
_this.authService.loginWithToken(token, 'microsoftb2c').subscribe(function () {
|
|
953
|
-
_this.appRef.tick();
|
|
954
|
-
_this.login.emit(true);
|
|
955
|
-
});
|
|
956
|
-
})
|
|
957
|
-
.catch(function (error) { return __awaiter(_this, void 0, void 0, function () {
|
|
958
|
-
return __generator(this, function (_a) {
|
|
959
|
-
if (error instanceof msalBrowser.InteractionRequiredAuthError) {
|
|
960
|
-
// fallback to interaction when silent call fails
|
|
961
|
-
return [2 /*return*/, this.msalService.acquireTokenPopup(this.getConf().authRequest)];
|
|
962
|
-
}
|
|
963
|
-
return [2 /*return*/];
|
|
964
|
-
});
|
|
965
|
-
}); }).catch(function (error) {
|
|
966
|
-
console.log('Silent token fails');
|
|
967
|
-
});
|
|
968
|
-
};
|
|
969
|
-
AuthMicrosoftb2cComponent.prototype.getConf = function () {
|
|
970
|
-
return this.msalGuardConfig.filter(function (conf) { return conf.type === 'b2c'; })[0];
|
|
971
|
-
};
|
|
972
|
-
return AuthMicrosoftb2cComponent;
|
|
973
|
-
}());
|
|
974
|
-
AuthMicrosoftb2cComponent.ɵfac = function AuthMicrosoftb2cComponent_Factory(t) { return new (t || AuthMicrosoftb2cComponent)(i0__namespace.ɵɵdirectiveInject(AuthService), i0__namespace.ɵɵdirectiveInject(i2__namespace.ConfigService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ApplicationRef), i0__namespace.ɵɵdirectiveInject(MsalServiceb2c), i0__namespace.ɵɵdirectiveInject(i3$1.MSAL_GUARD_CONFIG)); };
|
|
975
|
-
AuthMicrosoftb2cComponent.ɵcmp = /*@__PURE__*/ i0__namespace.ɵɵdefineComponent({ type: AuthMicrosoftb2cComponent, selectors: [["igo-auth-microsoftb2c"]], outputs: { login: "login" }, decls: 4, vars: 3, consts: [["mat-raised-button", "", 1, "microsoft-login-button", 3, "click"], ["svgIcon", "microsoft"]], template: function AuthMicrosoftb2cComponent_Template(rf, ctx) {
|
|
976
|
-
if (rf & 1) {
|
|
977
|
-
i0__namespace.ɵɵelementStart(0, "button", 0);
|
|
978
|
-
i0__namespace.ɵɵlistener("click", function AuthMicrosoftb2cComponent_Template_button_click_0_listener() { return ctx.loginMicrosoftb2c(); });
|
|
979
|
-
i0__namespace.ɵɵelement(1, "mat-icon", 1);
|
|
980
|
-
i0__namespace.ɵɵtext(2);
|
|
981
|
-
i0__namespace.ɵɵpipe(3, "translate");
|
|
982
|
-
i0__namespace.ɵɵelementEnd();
|
|
983
|
-
}
|
|
984
|
-
if (rf & 2) {
|
|
985
|
-
i0__namespace.ɵɵadvance(2);
|
|
986
|
-
i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(3, 1, "igo.auth.microsoftb2c.login"), "\n");
|
|
987
|
-
}
|
|
988
|
-
}, directives: [i4__namespace.MatButton, i5__namespace.MatIcon], pipes: [i6__namespace.TranslatePipe], styles: ["[_nghost-%COMP%]{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}[_nghost-%COMP%] > button[_ngcontent-%COMP%]{font-size:15px;height:40px;width:265px}mat-icon[_ngcontent-%COMP%]{margin-right:10px}"], changeDetection: 0 });
|
|
989
|
-
(function () {
|
|
990
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(AuthMicrosoftb2cComponent, [{
|
|
991
|
-
type: i0.Component,
|
|
992
|
-
args: [{
|
|
993
|
-
selector: 'igo-auth-microsoftb2c',
|
|
994
|
-
templateUrl: './auth-microsoftb2c.component.html',
|
|
995
|
-
styleUrls: ['./auth-microsoftb2c.component.scss'],
|
|
996
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
997
|
-
}]
|
|
998
|
-
}], function () {
|
|
999
|
-
return [{ type: AuthService }, { type: i2__namespace.ConfigService }, { type: i0__namespace.ApplicationRef }, { type: MsalServiceb2c }, { type: undefined, decorators: [{
|
|
1000
|
-
type: i0.Inject,
|
|
1001
|
-
args: [i3$1.MSAL_GUARD_CONFIG]
|
|
1002
|
-
}] }];
|
|
1003
|
-
}, { login: [{
|
|
1004
|
-
type: i0.Output
|
|
1005
|
-
}] });
|
|
1006
|
-
})();
|
|
1007
|
-
|
|
1008
|
-
var AuthFacebookComponent = /** @class */ (function () {
|
|
1009
|
-
function AuthFacebookComponent(authService, config, appRef) {
|
|
1010
|
-
this.authService = authService;
|
|
1011
|
-
this.config = config;
|
|
1012
|
-
this.appRef = appRef;
|
|
1013
|
-
this.login = new i0.EventEmitter();
|
|
1014
|
-
this.options = this.config.getConfig('auth.facebook') || {};
|
|
1015
|
-
if (this.options.appId) {
|
|
1016
|
-
this.loadSDKFacebook();
|
|
1017
|
-
}
|
|
1018
|
-
else {
|
|
1019
|
-
console.warn('Facebook authentification needs "appId" option');
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
AuthFacebookComponent.prototype.subscribeEvents = function () {
|
|
1023
|
-
var _this = this;
|
|
1024
|
-
window.FB.Event.subscribe('auth.statusChange', function (rep) {
|
|
1025
|
-
_this.statusChangeCallback(rep);
|
|
1026
|
-
});
|
|
1027
|
-
};
|
|
1028
|
-
AuthFacebookComponent.prototype.statusChangeCallback = function (response) {
|
|
1029
|
-
if (response.status === 'connected') {
|
|
1030
|
-
var accessToken = response.authResponse.accessToken;
|
|
1031
|
-
this.loginFacebook(accessToken);
|
|
1032
|
-
}
|
|
1033
|
-
};
|
|
1034
|
-
AuthFacebookComponent.prototype.loginFacebook = function (token) {
|
|
1035
|
-
var _this = this;
|
|
1036
|
-
this.authService.loginWithToken(token, 'facebook').subscribe(function () {
|
|
1037
|
-
_this.appRef.tick();
|
|
1038
|
-
_this.login.emit(true);
|
|
1039
|
-
});
|
|
1040
|
-
};
|
|
1041
|
-
AuthFacebookComponent.prototype.loadSDKFacebook = function () {
|
|
1042
|
-
var _this = this;
|
|
1043
|
-
if (document.getElementById('facebook-jssdk')) {
|
|
1044
|
-
return;
|
|
1045
|
-
}
|
|
1046
|
-
var urlSDK = 'https://connect.facebook.net/fr_CA/sdk.js#xfbml=1&version=v2.9';
|
|
1047
|
-
var fjs = document.getElementsByTagName('script')[0];
|
|
1048
|
-
var js = document.createElement('script');
|
|
1049
|
-
js.id = 'facebook-jssdk';
|
|
1050
|
-
js.src = urlSDK + "&appId=" + this.options.appId;
|
|
1051
|
-
js.onload = function () {
|
|
1052
|
-
_this.subscribeEvents();
|
|
1053
|
-
};
|
|
1054
|
-
fjs.parentNode.insertBefore(js, fjs);
|
|
1055
|
-
};
|
|
1056
|
-
return AuthFacebookComponent;
|
|
1057
|
-
}());
|
|
1058
|
-
AuthFacebookComponent.ɵfac = function AuthFacebookComponent_Factory(t) { return new (t || AuthFacebookComponent)(i0__namespace.ɵɵdirectiveInject(AuthService), i0__namespace.ɵɵdirectiveInject(i2__namespace.ConfigService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ApplicationRef)); };
|
|
1059
|
-
AuthFacebookComponent.ɵcmp = /*@__PURE__*/ i0__namespace.ɵɵ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) {
|
|
1060
|
-
if (rf & 1) {
|
|
1061
|
-
i0__namespace.ɵɵelement(0, "div", 0);
|
|
1062
|
-
}
|
|
1063
|
-
}, styles: ["[_nghost-%COMP%]{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-3px}"], changeDetection: 0 });
|
|
1064
|
-
(function () {
|
|
1065
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(AuthFacebookComponent, [{
|
|
1066
|
-
type: i0.Component,
|
|
1067
|
-
args: [{
|
|
1068
|
-
selector: 'igo-auth-facebook',
|
|
1069
|
-
templateUrl: './auth-facebook.component.html',
|
|
1070
|
-
styleUrls: ['./auth-facebook.component.scss'],
|
|
1071
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1072
|
-
}]
|
|
1073
|
-
}], function () { return [{ type: AuthService }, { type: i2__namespace.ConfigService }, { type: i0__namespace.ApplicationRef }]; }, { login: [{
|
|
1074
|
-
type: i0.Output
|
|
1075
|
-
}] });
|
|
1076
|
-
})();
|
|
1077
|
-
|
|
1078
|
-
function AuthInternComponent_button_12_Template(rf, ctx) {
|
|
1079
|
-
if (rf & 1) {
|
|
1080
|
-
var _r3_1 = i0__namespace.ɵɵgetCurrentView();
|
|
1081
|
-
i0__namespace.ɵɵelementStart(0, "button", 7);
|
|
1082
|
-
i0__namespace.ɵɵlistener("click", function AuthInternComponent_button_12_Template_button_click_0_listener() { i0__namespace.ɵɵrestoreView(_r3_1); var ctx_r2 = i0__namespace.ɵɵnextContext(); return ctx_r2.loginAnonymous(); });
|
|
1083
|
-
i0__namespace.ɵɵtext(1);
|
|
1084
|
-
i0__namespace.ɵɵpipe(2, "translate");
|
|
1085
|
-
i0__namespace.ɵɵelementEnd();
|
|
1086
|
-
}
|
|
1087
|
-
if (rf & 2) {
|
|
1088
|
-
var ctx_r0 = i0__namespace.ɵɵnextContext();
|
|
1089
|
-
i0__namespace.ɵɵproperty("disabled", ctx_r0.loading);
|
|
1090
|
-
i0__namespace.ɵɵadvance(1);
|
|
1091
|
-
i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(2, 2, "igo.auth.accessAnonymous"), " ");
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
function AuthInternComponent_div_13_Template(rf, ctx) {
|
|
1095
|
-
if (rf & 1) {
|
|
1096
|
-
i0__namespace.ɵɵelementStart(0, "div");
|
|
1097
|
-
i0__namespace.ɵɵelement(1, "br");
|
|
1098
|
-
i0__namespace.ɵɵelementStart(2, "font", 8);
|
|
1099
|
-
i0__namespace.ɵɵtext(3);
|
|
1100
|
-
i0__namespace.ɵɵelementEnd();
|
|
1101
|
-
i0__namespace.ɵɵelementEnd();
|
|
1102
|
-
}
|
|
1103
|
-
if (rf & 2) {
|
|
1104
|
-
var ctx_r1 = i0__namespace.ɵɵnextContext();
|
|
1105
|
-
i0__namespace.ɵɵadvance(3);
|
|
1106
|
-
i0__namespace.ɵɵtextInterpolate(ctx_r1.error);
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
var AuthInternComponent = /** @class */ (function () {
|
|
1110
|
-
function AuthInternComponent(auth, languageService, fb) {
|
|
1111
|
-
this.auth = auth;
|
|
1112
|
-
this.languageService = languageService;
|
|
1113
|
-
this._allowAnonymous = true;
|
|
1114
|
-
this.error = '';
|
|
1115
|
-
this.loading = false;
|
|
1116
|
-
this.login = new i0.EventEmitter();
|
|
1117
|
-
this.form = fb.group({
|
|
1118
|
-
username: ['', i3$2.Validators.required],
|
|
1119
|
-
password: ['', i3$2.Validators.required]
|
|
1120
|
-
});
|
|
1121
|
-
}
|
|
1122
|
-
Object.defineProperty(AuthInternComponent.prototype, "allowAnonymous", {
|
|
1123
|
-
get: function () {
|
|
1124
|
-
return this._allowAnonymous;
|
|
1125
|
-
},
|
|
1126
|
-
set: function (value) {
|
|
1127
|
-
this._allowAnonymous = value;
|
|
1128
|
-
},
|
|
1129
|
-
enumerable: false,
|
|
1130
|
-
configurable: true
|
|
1131
|
-
});
|
|
1132
|
-
AuthInternComponent.prototype.loginUser = function (values) {
|
|
1133
|
-
var _this = this;
|
|
1134
|
-
this.loading = true;
|
|
1135
|
-
this.auth.login(values.username, values.password).subscribe(function () {
|
|
1136
|
-
_this.login.emit(true);
|
|
1137
|
-
_this.loading = false;
|
|
1138
|
-
}, function (error) {
|
|
1139
|
-
try {
|
|
1140
|
-
_this.languageService.translate
|
|
1141
|
-
.get('igo.auth.error.' + error.error.message)
|
|
1142
|
-
.subscribe(function (errorMsg) { return (_this.error = errorMsg); });
|
|
1143
|
-
}
|
|
1144
|
-
catch (e) {
|
|
1145
|
-
_this.error = error.error.message;
|
|
1146
|
-
}
|
|
1147
|
-
_this.loading = false;
|
|
1148
|
-
});
|
|
1149
|
-
return false;
|
|
1150
|
-
};
|
|
1151
|
-
AuthInternComponent.prototype.loginAnonymous = function () {
|
|
1152
|
-
var _this = this;
|
|
1153
|
-
this.auth.loginAnonymous().subscribe(function () {
|
|
1154
|
-
_this.login.emit(true);
|
|
1155
|
-
});
|
|
1156
|
-
};
|
|
1157
|
-
return AuthInternComponent;
|
|
1158
|
-
}());
|
|
1159
|
-
AuthInternComponent.ɵfac = function AuthInternComponent_Factory(t) { return new (t || AuthInternComponent)(i0__namespace.ɵɵdirectiveInject(AuthService), i0__namespace.ɵɵdirectiveInject(i2__namespace.LanguageService), i0__namespace.ɵɵdirectiveInject(i3__namespace$2.FormBuilder)); };
|
|
1160
|
-
AuthInternComponent.ɵcmp = /*@__PURE__*/ i0__namespace.ɵɵdefineComponent({ type: AuthInternComponent, selectors: [["igo-auth-intern"]], inputs: { allowAnonymous: "allowAnonymous" }, outputs: { login: "login" }, decls: 14, vars: 12, consts: [["role", "form", 3, "formGroup", "ngSubmit"], [1, "full-width"], ["matInput", "", "required", "", "formControlName", "username", 3, "placeholder"], ["matInput", "", "required", "", "type", "password", "formControlName", "password", 3, "placeholder"], ["mat-raised-button", "", "type", "submit"], ["mat-raised-button", "", "class", "anonymous", "type", "button", 3, "disabled", "click", 4, "ngIf"], [4, "ngIf"], ["mat-raised-button", "", "type", "button", 1, "anonymous", 3, "disabled", "click"], ["size", "3", "color", "red"]], template: function AuthInternComponent_Template(rf, ctx) {
|
|
1161
|
-
if (rf & 1) {
|
|
1162
|
-
i0__namespace.ɵɵelementStart(0, "form", 0);
|
|
1163
|
-
i0__namespace.ɵɵlistener("ngSubmit", function AuthInternComponent_Template_form_ngSubmit_0_listener() { return ctx.loginUser(ctx.form.value); });
|
|
1164
|
-
i0__namespace.ɵɵelementStart(1, "div");
|
|
1165
|
-
i0__namespace.ɵɵelementStart(2, "mat-form-field", 1);
|
|
1166
|
-
i0__namespace.ɵɵelement(3, "input", 2);
|
|
1167
|
-
i0__namespace.ɵɵpipe(4, "translate");
|
|
1168
|
-
i0__namespace.ɵɵelementEnd();
|
|
1169
|
-
i0__namespace.ɵɵelementEnd();
|
|
1170
|
-
i0__namespace.ɵɵelementStart(5, "div");
|
|
1171
|
-
i0__namespace.ɵɵelementStart(6, "mat-form-field", 1);
|
|
1172
|
-
i0__namespace.ɵɵelement(7, "input", 3);
|
|
1173
|
-
i0__namespace.ɵɵpipe(8, "translate");
|
|
1174
|
-
i0__namespace.ɵɵelementEnd();
|
|
1175
|
-
i0__namespace.ɵɵelementEnd();
|
|
1176
|
-
i0__namespace.ɵɵelementStart(9, "button", 4);
|
|
1177
|
-
i0__namespace.ɵɵtext(10);
|
|
1178
|
-
i0__namespace.ɵɵpipe(11, "translate");
|
|
1179
|
-
i0__namespace.ɵɵelementEnd();
|
|
1180
|
-
i0__namespace.ɵɵtemplate(12, AuthInternComponent_button_12_Template, 3, 4, "button", 5);
|
|
1181
|
-
i0__namespace.ɵɵtemplate(13, AuthInternComponent_div_13_Template, 4, 1, "div", 6);
|
|
1182
|
-
i0__namespace.ɵɵelementEnd();
|
|
1183
|
-
}
|
|
1184
|
-
if (rf & 2) {
|
|
1185
|
-
i0__namespace.ɵɵproperty("formGroup", ctx.form);
|
|
1186
|
-
i0__namespace.ɵɵadvance(3);
|
|
1187
|
-
i0__namespace.ɵɵpropertyInterpolate("placeholder", i0__namespace.ɵɵpipeBind1(4, 6, "igo.auth.user"));
|
|
1188
|
-
i0__namespace.ɵɵadvance(4);
|
|
1189
|
-
i0__namespace.ɵɵpropertyInterpolate("placeholder", i0__namespace.ɵɵpipeBind1(8, 8, "igo.auth.password"));
|
|
1190
|
-
i0__namespace.ɵɵadvance(3);
|
|
1191
|
-
i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(11, 10, "igo.auth.login"));
|
|
1192
|
-
i0__namespace.ɵɵadvance(2);
|
|
1193
|
-
i0__namespace.ɵɵproperty("ngIf", ctx.allowAnonymous);
|
|
1194
|
-
i0__namespace.ɵɵadvance(1);
|
|
1195
|
-
i0__namespace.ɵɵproperty("ngIf", ctx.error);
|
|
1196
|
-
}
|
|
1197
|
-
}, directives: [i3__namespace$2.ɵNgNoValidate, i3__namespace$2.NgControlStatusGroup, i3__namespace$2.FormGroupDirective, i4__namespace$1.MatFormField, i5__namespace$1.MatInput, i3__namespace$2.DefaultValueAccessor, i3__namespace$2.RequiredValidator, i3__namespace$2.NgControlStatus, i3__namespace$2.FormControlName, i4__namespace.MatButton, i1__namespace$1.NgIf], pipes: [i6__namespace.TranslatePipe], styles: [".full-width[_ngcontent-%COMP%]{width:100%}.anonymous[_ngcontent-%COMP%]{margin-left:10px}"] });
|
|
1198
|
-
(function () {
|
|
1199
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(AuthInternComponent, [{
|
|
1200
|
-
type: i0.Component,
|
|
1201
|
-
args: [{
|
|
1202
|
-
selector: 'igo-auth-intern',
|
|
1203
|
-
templateUrl: './auth-intern.component.html',
|
|
1204
|
-
styleUrls: ['./auth-intern.component.scss'],
|
|
1205
|
-
changeDetection: i0.ChangeDetectionStrategy.Default
|
|
1206
|
-
}]
|
|
1207
|
-
}], function () { return [{ type: AuthService }, { type: i2__namespace.LanguageService }, { type: i3__namespace$2.FormBuilder }]; }, { allowAnonymous: [{
|
|
1208
|
-
type: i0.Input
|
|
1209
|
-
}], login: [{
|
|
1210
|
-
type: i0.Output
|
|
1211
|
-
}] });
|
|
1212
|
-
})();
|
|
1213
|
-
|
|
1214
|
-
function AuthFormComponent_div_0_div_1_Template(rf, ctx) {
|
|
1215
|
-
if (rf & 1) {
|
|
1216
|
-
i0__namespace.ɵɵelement(0, "div", 3);
|
|
1217
|
-
}
|
|
1218
|
-
}
|
|
1219
|
-
function AuthFormComponent_div_0_div_2_igo_auth_google_4_Template(rf, ctx) {
|
|
1220
|
-
if (rf & 1) {
|
|
1221
|
-
var _r11_1 = i0__namespace.ɵɵgetCurrentView();
|
|
1222
|
-
i0__namespace.ɵɵelementStart(0, "igo-auth-google", 7);
|
|
1223
|
-
i0__namespace.ɵɵlistener("login", function AuthFormComponent_div_0_div_2_igo_auth_google_4_Template_igo_auth_google_login_0_listener() { i0__namespace.ɵɵrestoreView(_r11_1); var ctx_r10 = i0__namespace.ɵɵnextContext(3); return ctx_r10.onLogin(); });
|
|
1224
|
-
i0__namespace.ɵɵelementEnd();
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1227
|
-
function AuthFormComponent_div_0_div_2_igo_auth_microsoft_5_Template(rf, ctx) {
|
|
1228
|
-
if (rf & 1) {
|
|
1229
|
-
var _r13_1 = i0__namespace.ɵɵgetCurrentView();
|
|
1230
|
-
i0__namespace.ɵɵelementStart(0, "igo-auth-microsoft", 7);
|
|
1231
|
-
i0__namespace.ɵɵlistener("login", function AuthFormComponent_div_0_div_2_igo_auth_microsoft_5_Template_igo_auth_microsoft_login_0_listener() { i0__namespace.ɵɵrestoreView(_r13_1); var ctx_r12 = i0__namespace.ɵɵnextContext(3); return ctx_r12.onLogin(); });
|
|
1232
|
-
i0__namespace.ɵɵelementEnd();
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
function AuthFormComponent_div_0_div_2_igo_auth_microsoftb2c_6_Template(rf, ctx) {
|
|
1236
|
-
if (rf & 1) {
|
|
1237
|
-
var _r15_1 = i0__namespace.ɵɵgetCurrentView();
|
|
1238
|
-
i0__namespace.ɵɵelementStart(0, "igo-auth-microsoftb2c", 7);
|
|
1239
|
-
i0__namespace.ɵɵlistener("login", function AuthFormComponent_div_0_div_2_igo_auth_microsoftb2c_6_Template_igo_auth_microsoftb2c_login_0_listener() { i0__namespace.ɵɵrestoreView(_r15_1); var ctx_r14 = i0__namespace.ɵɵnextContext(3); return ctx_r14.onLogin(); });
|
|
1240
|
-
i0__namespace.ɵɵelementEnd();
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
function AuthFormComponent_div_0_div_2_igo_auth_facebook_7_Template(rf, ctx) {
|
|
1244
|
-
if (rf & 1) {
|
|
1245
|
-
var _r17_1 = i0__namespace.ɵɵgetCurrentView();
|
|
1246
|
-
i0__namespace.ɵɵelementStart(0, "igo-auth-facebook", 7);
|
|
1247
|
-
i0__namespace.ɵɵlistener("login", function AuthFormComponent_div_0_div_2_igo_auth_facebook_7_Template_igo_auth_facebook_login_0_listener() { i0__namespace.ɵɵrestoreView(_r17_1); var ctx_r16 = i0__namespace.ɵɵnextContext(3); return ctx_r16.onLogin(); });
|
|
1248
|
-
i0__namespace.ɵɵelementEnd();
|
|
1249
|
-
}
|
|
1250
|
-
}
|
|
1251
|
-
function AuthFormComponent_div_0_div_2_igo_auth_intern_8_Template(rf, ctx) {
|
|
1252
|
-
if (rf & 1) {
|
|
1253
|
-
var _r19_1 = i0__namespace.ɵɵgetCurrentView();
|
|
1254
|
-
i0__namespace.ɵɵelementStart(0, "igo-auth-intern", 8);
|
|
1255
|
-
i0__namespace.ɵɵlistener("login", function AuthFormComponent_div_0_div_2_igo_auth_intern_8_Template_igo_auth_intern_login_0_listener() { i0__namespace.ɵɵrestoreView(_r19_1); var ctx_r18 = i0__namespace.ɵɵnextContext(3); return ctx_r18.onLogin(); });
|
|
1256
|
-
i0__namespace.ɵɵelementEnd();
|
|
1257
|
-
}
|
|
1258
|
-
if (rf & 2) {
|
|
1259
|
-
var ctx_r9 = i0__namespace.ɵɵnextContext(3);
|
|
1260
|
-
i0__namespace.ɵɵproperty("allowAnonymous", ctx_r9.options.allowAnonymous);
|
|
1261
|
-
}
|
|
1262
|
-
}
|
|
1263
|
-
function AuthFormComponent_div_0_div_2_Template(rf, ctx) {
|
|
1264
|
-
if (rf & 1) {
|
|
1265
|
-
i0__namespace.ɵɵelementStart(0, "div", 4);
|
|
1266
|
-
i0__namespace.ɵɵelementStart(1, "h1");
|
|
1267
|
-
i0__namespace.ɵɵtext(2);
|
|
1268
|
-
i0__namespace.ɵɵpipe(3, "translate");
|
|
1269
|
-
i0__namespace.ɵɵelementEnd();
|
|
1270
|
-
i0__namespace.ɵɵtemplate(4, AuthFormComponent_div_0_div_2_igo_auth_google_4_Template, 1, 0, "igo-auth-google", 5);
|
|
1271
|
-
i0__namespace.ɵɵtemplate(5, AuthFormComponent_div_0_div_2_igo_auth_microsoft_5_Template, 1, 0, "igo-auth-microsoft", 5);
|
|
1272
|
-
i0__namespace.ɵɵtemplate(6, AuthFormComponent_div_0_div_2_igo_auth_microsoftb2c_6_Template, 1, 0, "igo-auth-microsoftb2c", 5);
|
|
1273
|
-
i0__namespace.ɵɵtemplate(7, AuthFormComponent_div_0_div_2_igo_auth_facebook_7_Template, 1, 0, "igo-auth-facebook", 5);
|
|
1274
|
-
i0__namespace.ɵɵtemplate(8, AuthFormComponent_div_0_div_2_igo_auth_intern_8_Template, 1, 1, "igo-auth-intern", 6);
|
|
1275
|
-
i0__namespace.ɵɵelementEnd();
|
|
1276
|
-
}
|
|
1277
|
-
if (rf & 2) {
|
|
1278
|
-
var ctx_r2 = i0__namespace.ɵɵnextContext(2);
|
|
1279
|
-
i0__namespace.ɵɵadvance(2);
|
|
1280
|
-
i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(3, 6, "igo.auth.connection"));
|
|
1281
|
-
i0__namespace.ɵɵadvance(2);
|
|
1282
|
-
i0__namespace.ɵɵproperty("ngIf", ctx_r2.options.google && ctx_r2.options.google.enabled !== false);
|
|
1283
|
-
i0__namespace.ɵɵadvance(1);
|
|
1284
|
-
i0__namespace.ɵɵproperty("ngIf", ctx_r2.options.microsoft && ctx_r2.options.microsoft.enabled !== false);
|
|
1285
|
-
i0__namespace.ɵɵadvance(1);
|
|
1286
|
-
i0__namespace.ɵɵproperty("ngIf", ctx_r2.options.microsoftb2c && ctx_r2.options.microsoftb2c.enabled !== false);
|
|
1287
|
-
i0__namespace.ɵɵadvance(1);
|
|
1288
|
-
i0__namespace.ɵɵproperty("ngIf", ctx_r2.options.facebook && ctx_r2.options.facebook.enabled !== false);
|
|
1289
|
-
i0__namespace.ɵɵadvance(1);
|
|
1290
|
-
i0__namespace.ɵɵproperty("ngIf", !ctx_r2.options.intern || ctx_r2.options.intern.enabled !== false);
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
function AuthFormComponent_div_0_div_3_Template(rf, ctx) {
|
|
1294
|
-
if (rf & 1) {
|
|
1295
|
-
var _r21_1 = i0__namespace.ɵɵgetCurrentView();
|
|
1296
|
-
i0__namespace.ɵɵelementStart(0, "div", 4);
|
|
1297
|
-
i0__namespace.ɵɵelementStart(1, "p");
|
|
1298
|
-
i0__namespace.ɵɵtext(2);
|
|
1299
|
-
i0__namespace.ɵɵpipe(3, "translate");
|
|
1300
|
-
i0__namespace.ɵɵelementEnd();
|
|
1301
|
-
i0__namespace.ɵɵelementStart(4, "button", 9);
|
|
1302
|
-
i0__namespace.ɵɵlistener("click", function AuthFormComponent_div_0_div_3_Template_button_click_4_listener() { i0__namespace.ɵɵrestoreView(_r21_1); var ctx_r20 = i0__namespace.ɵɵnextContext(2); return ctx_r20.logout(); });
|
|
1303
|
-
i0__namespace.ɵɵtext(5);
|
|
1304
|
-
i0__namespace.ɵɵpipe(6, "translate");
|
|
1305
|
-
i0__namespace.ɵɵelementEnd();
|
|
1306
|
-
i0__namespace.ɵɵelementEnd();
|
|
1307
|
-
}
|
|
1308
|
-
if (rf & 2) {
|
|
1309
|
-
var ctx_r3 = i0__namespace.ɵɵnextContext(2);
|
|
1310
|
-
i0__namespace.ɵɵadvance(2);
|
|
1311
|
-
i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind2(3, 2, "igo.auth.welcome", ctx_r3.user));
|
|
1312
|
-
i0__namespace.ɵɵadvance(3);
|
|
1313
|
-
i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(6, 5, "igo.auth.signOut"));
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
function AuthFormComponent_div_0_div_4_button_4_Template(rf, ctx) {
|
|
1317
|
-
if (rf & 1) {
|
|
1318
|
-
var _r24_1 = i0__namespace.ɵɵgetCurrentView();
|
|
1319
|
-
i0__namespace.ɵɵelementStart(0, "button", 9);
|
|
1320
|
-
i0__namespace.ɵɵlistener("click", function AuthFormComponent_div_0_div_4_button_4_Template_button_click_0_listener() { i0__namespace.ɵɵrestoreView(_r24_1); var ctx_r23 = i0__namespace.ɵɵnextContext(3); return ctx_r23.home(); });
|
|
1321
|
-
i0__namespace.ɵɵtext(1);
|
|
1322
|
-
i0__namespace.ɵɵpipe(2, "translate");
|
|
1323
|
-
i0__namespace.ɵɵelementEnd();
|
|
1324
|
-
}
|
|
1325
|
-
if (rf & 2) {
|
|
1326
|
-
i0__namespace.ɵɵadvance(1);
|
|
1327
|
-
i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(2, 1, "igo.auth.home"));
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
function AuthFormComponent_div_0_div_4_Template(rf, ctx) {
|
|
1331
|
-
if (rf & 1) {
|
|
1332
|
-
i0__namespace.ɵɵelementStart(0, "div", 4);
|
|
1333
|
-
i0__namespace.ɵɵelementStart(1, "p");
|
|
1334
|
-
i0__namespace.ɵɵtext(2);
|
|
1335
|
-
i0__namespace.ɵɵpipe(3, "translate");
|
|
1336
|
-
i0__namespace.ɵɵelementEnd();
|
|
1337
|
-
i0__namespace.ɵɵtemplate(4, AuthFormComponent_div_0_div_4_button_4_Template, 3, 3, "button", 10);
|
|
1338
|
-
i0__namespace.ɵɵelementEnd();
|
|
1339
|
-
}
|
|
1340
|
-
if (rf & 2) {
|
|
1341
|
-
var ctx_r4 = i0__namespace.ɵɵnextContext(2);
|
|
1342
|
-
i0__namespace.ɵɵadvance(2);
|
|
1343
|
-
i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(3, 2, "igo.auth.deconnection"));
|
|
1344
|
-
i0__namespace.ɵɵadvance(2);
|
|
1345
|
-
i0__namespace.ɵɵproperty("ngIf", ctx_r4.options.homeRoute);
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
function AuthFormComponent_div_0_Template(rf, ctx) {
|
|
1349
|
-
if (rf & 1) {
|
|
1350
|
-
i0__namespace.ɵɵelementStart(0, "div");
|
|
1351
|
-
i0__namespace.ɵɵtemplate(1, AuthFormComponent_div_0_div_1_Template, 1, 0, "div", 1);
|
|
1352
|
-
i0__namespace.ɵɵtemplate(2, AuthFormComponent_div_0_div_2_Template, 9, 8, "div", 2);
|
|
1353
|
-
i0__namespace.ɵɵtemplate(3, AuthFormComponent_div_0_div_3_Template, 7, 7, "div", 2);
|
|
1354
|
-
i0__namespace.ɵɵtemplate(4, AuthFormComponent_div_0_div_4_Template, 5, 4, "div", 2);
|
|
1355
|
-
i0__namespace.ɵɵelementEnd();
|
|
1356
|
-
}
|
|
1357
|
-
if (rf & 2) {
|
|
1358
|
-
var ctx_r0 = i0__namespace.ɵɵnextContext();
|
|
1359
|
-
i0__namespace.ɵɵadvance(1);
|
|
1360
|
-
i0__namespace.ɵɵproperty("ngIf", !ctx_r0.auth.logged && ctx_r0.backgroundDisable);
|
|
1361
|
-
i0__namespace.ɵɵadvance(1);
|
|
1362
|
-
i0__namespace.ɵɵproperty("ngIf", !ctx_r0.auth.logged && ctx_r0.showLoginDiv);
|
|
1363
|
-
i0__namespace.ɵɵadvance(1);
|
|
1364
|
-
i0__namespace.ɵɵproperty("ngIf", ctx_r0.auth.logged && ctx_r0.showAlreadyConnectedDiv);
|
|
1365
|
-
i0__namespace.ɵɵadvance(1);
|
|
1366
|
-
i0__namespace.ɵɵproperty("ngIf", ctx_r0.showLogoutDiv);
|
|
1367
|
-
}
|
|
1368
|
-
}
|
|
1369
|
-
var AuthFormComponent = /** @class */ (function () {
|
|
1370
|
-
function AuthFormComponent(auth, config, router) {
|
|
1371
|
-
this.auth = auth;
|
|
1372
|
-
this.config = config;
|
|
1373
|
-
this.router = router;
|
|
1374
|
-
this._backgroundDisable = true;
|
|
1375
|
-
this._hasAlreadyConnectedDiv = true;
|
|
1376
|
-
this._hasLogoutDiv = true;
|
|
1377
|
-
this._showAlreadyConnectedDiv = false;
|
|
1378
|
-
this._showLogoutDiv = false;
|
|
1379
|
-
this.login = new i0.EventEmitter();
|
|
1380
|
-
this.visible = true;
|
|
1381
|
-
this.options = this.config.getConfig('auth') || {};
|
|
1382
|
-
this.visible = Object.getOwnPropertyNames(this.options).length !== 0;
|
|
1383
|
-
}
|
|
1384
|
-
Object.defineProperty(AuthFormComponent.prototype, "backgroundDisable", {
|
|
1385
|
-
get: function () {
|
|
1386
|
-
if (this.isLogoutRoute || this.isLogoutRoute) {
|
|
1387
|
-
return false;
|
|
1388
|
-
}
|
|
1389
|
-
return this._backgroundDisable;
|
|
1390
|
-
},
|
|
1391
|
-
set: function (value) {
|
|
1392
|
-
this._backgroundDisable = value.toString() === 'true';
|
|
1393
|
-
},
|
|
1394
|
-
enumerable: false,
|
|
1395
|
-
configurable: true
|
|
1396
|
-
});
|
|
1397
|
-
Object.defineProperty(AuthFormComponent.prototype, "hasAlreadyConnectedDiv", {
|
|
1398
|
-
get: function () {
|
|
1399
|
-
return this._hasAlreadyConnectedDiv;
|
|
1400
|
-
},
|
|
1401
|
-
set: function (value) {
|
|
1402
|
-
this._hasAlreadyConnectedDiv = value.toString() === 'true';
|
|
1403
|
-
},
|
|
1404
|
-
enumerable: false,
|
|
1405
|
-
configurable: true
|
|
1406
|
-
});
|
|
1407
|
-
Object.defineProperty(AuthFormComponent.prototype, "hasLogoutDiv", {
|
|
1408
|
-
get: function () {
|
|
1409
|
-
return this._hasLogoutDiv;
|
|
1410
|
-
},
|
|
1411
|
-
set: function (value) {
|
|
1412
|
-
this._hasLogoutDiv = value.toString() === 'true';
|
|
1413
|
-
},
|
|
1414
|
-
enumerable: false,
|
|
1415
|
-
configurable: true
|
|
1416
|
-
});
|
|
1417
|
-
Object.defineProperty(AuthFormComponent.prototype, "showAlreadyConnectedDiv", {
|
|
1418
|
-
get: function () {
|
|
1419
|
-
if (this.isLogoutRoute) {
|
|
1420
|
-
return this.hasAlreadyConnectedDiv;
|
|
1421
|
-
}
|
|
1422
|
-
return this._showAlreadyConnectedDiv;
|
|
1423
|
-
},
|
|
1424
|
-
set: function (value) {
|
|
1425
|
-
this._showAlreadyConnectedDiv = value.toString() === 'true';
|
|
1426
|
-
},
|
|
1427
|
-
enumerable: false,
|
|
1428
|
-
configurable: true
|
|
1429
|
-
});
|
|
1430
|
-
Object.defineProperty(AuthFormComponent.prototype, "showLogoutDiv", {
|
|
1431
|
-
get: function () {
|
|
1432
|
-
if (this.isLogoutRoute) {
|
|
1433
|
-
return this.hasLogoutDiv;
|
|
1434
|
-
}
|
|
1435
|
-
return this._showLogoutDiv;
|
|
1436
|
-
},
|
|
1437
|
-
set: function (value) {
|
|
1438
|
-
this._showLogoutDiv = value.toString() === 'true';
|
|
1439
|
-
},
|
|
1440
|
-
enumerable: false,
|
|
1441
|
-
configurable: true
|
|
1442
|
-
});
|
|
1443
|
-
Object.defineProperty(AuthFormComponent.prototype, "showLoginDiv", {
|
|
1444
|
-
get: function () {
|
|
1445
|
-
if (!this.isLogoutRoute) {
|
|
1446
|
-
return true;
|
|
1447
|
-
}
|
|
1448
|
-
},
|
|
1449
|
-
enumerable: false,
|
|
1450
|
-
configurable: true
|
|
1451
|
-
});
|
|
1452
|
-
AuthFormComponent.prototype.ngOnInit = function () {
|
|
1453
|
-
this.analyzeRoute();
|
|
1454
|
-
this.getName();
|
|
1455
|
-
};
|
|
1456
|
-
AuthFormComponent.prototype.onLogin = function () {
|
|
1457
|
-
this.auth.goToRedirectUrl();
|
|
1458
|
-
this.getName();
|
|
1459
|
-
this.login.emit(true);
|
|
1460
|
-
};
|
|
1461
|
-
AuthFormComponent.prototype.logout = function () {
|
|
1462
|
-
var _this = this;
|
|
1463
|
-
this.auth.logout().subscribe(function () {
|
|
1464
|
-
_this.user = undefined;
|
|
1465
|
-
if (_this.router) {
|
|
1466
|
-
if (_this.options.logoutRoute) {
|
|
1467
|
-
_this.router.navigate([_this.options.logoutRoute]);
|
|
1468
|
-
}
|
|
1469
|
-
else if (_this.options.homeRoute) {
|
|
1470
|
-
_this.router.navigate([_this.options.homeRoute]);
|
|
1471
|
-
}
|
|
1472
|
-
}
|
|
1473
|
-
});
|
|
1474
|
-
};
|
|
1475
|
-
AuthFormComponent.prototype.home = function () {
|
|
1476
|
-
if (this.router && this.options.homeRoute) {
|
|
1477
|
-
this.router.navigate([this.options.homeRoute]);
|
|
1478
|
-
}
|
|
1479
|
-
};
|
|
1480
|
-
AuthFormComponent.prototype.getName = function () {
|
|
1481
|
-
var tokenDecoded = this.auth.decodeToken();
|
|
1482
|
-
if (tokenDecoded) {
|
|
1483
|
-
this.user = {
|
|
1484
|
-
name: tokenDecoded.user.firstName || tokenDecoded.user.sourceId
|
|
1485
|
-
};
|
|
1486
|
-
}
|
|
1487
|
-
};
|
|
1488
|
-
AuthFormComponent.prototype.analyzeRoute = function () {
|
|
1489
|
-
var _this = this;
|
|
1490
|
-
if (!this.router) {
|
|
1491
|
-
return;
|
|
1492
|
-
}
|
|
1493
|
-
this.router.events
|
|
1494
|
-
.pipe(operators.filter(function (event) { return event instanceof i3.NavigationStart; }))
|
|
1495
|
-
.subscribe(function (changeEvent) {
|
|
1496
|
-
if (changeEvent.url) {
|
|
1497
|
-
var currentRoute = changeEvent.url;
|
|
1498
|
-
var logoutRoute = _this.options.logoutRoute;
|
|
1499
|
-
var loginRoute = _this.options.loginRoute;
|
|
1500
|
-
_this.isLogoutRoute = currentRoute === logoutRoute;
|
|
1501
|
-
_this.isLoginRoute = currentRoute === loginRoute;
|
|
1502
|
-
if (_this.isLogoutRoute) {
|
|
1503
|
-
_this.auth.logout();
|
|
1504
|
-
}
|
|
1505
|
-
}
|
|
1506
|
-
});
|
|
1507
|
-
};
|
|
1508
|
-
return AuthFormComponent;
|
|
1509
|
-
}());
|
|
1510
|
-
AuthFormComponent.ɵfac = function AuthFormComponent_Factory(t) { return new (t || AuthFormComponent)(i0__namespace.ɵɵdirectiveInject(AuthService), i0__namespace.ɵɵdirectiveInject(i2__namespace.ConfigService), i0__namespace.ɵɵdirectiveInject(i3__namespace.Router, 8)); };
|
|
1511
|
-
AuthFormComponent.ɵcmp = /*@__PURE__*/ i0__namespace.ɵɵdefineComponent({ type: AuthFormComponent, selectors: [["igo-auth-form"]], inputs: { backgroundDisable: "backgroundDisable", hasAlreadyConnectedDiv: "hasAlreadyConnectedDiv", hasLogoutDiv: "hasLogoutDiv", showAlreadyConnectedDiv: "showAlreadyConnectedDiv", showLogoutDiv: "showLogoutDiv" }, outputs: { login: "login" }, decls: 1, vars: 1, consts: [[4, "ngIf"], ["class", "backgroundDisable", 4, "ngIf"], ["class", "login center-block", 4, "ngIf"], [1, "backgroundDisable"], [1, "login", "center-block"], [3, "login", 4, "ngIf"], [3, "allowAnonymous", "login", 4, "ngIf"], [3, "login"], [3, "allowAnonymous", "login"], ["mat-raised-button", "", "type", "button", 3, "click"], ["mat-raised-button", "", "type", "button", 3, "click", 4, "ngIf"]], template: function AuthFormComponent_Template(rf, ctx) {
|
|
1512
|
-
if (rf & 1) {
|
|
1513
|
-
i0__namespace.ɵɵtemplate(0, AuthFormComponent_div_0_Template, 5, 4, "div", 0);
|
|
1514
|
-
}
|
|
1515
|
-
if (rf & 2) {
|
|
1516
|
-
i0__namespace.ɵɵproperty("ngIf", ctx.visible);
|
|
1517
|
-
}
|
|
1518
|
-
}, directives: [i1__namespace$1.NgIf, AuthGoogleComponent, AuthMicrosoftComponent, AuthMicrosoftb2cComponent, AuthFacebookComponent, AuthInternComponent, i4__namespace.MatButton], pipes: [i6__namespace.TranslatePipe], styles: ["[_nghost-%COMP%]{z-index:999}div.login[_ngcontent-%COMP%]{z-index:200;width:90%;min-width:360px;max-width:600px;padding:25px 50px;border:1px solid;background-color:#fff;border-color:#888}.center-block[_ngcontent-%COMP%]{position:fixed;top:20%;left:50%;transform:translate(-50%)}.backgroundDisable[_ngcontent-%COMP%]{position:fixed;top:0;left:0;background:#000;opacity:.8;z-index:100;height:100%;width:100%}"] });
|
|
1519
|
-
(function () {
|
|
1520
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(AuthFormComponent, [{
|
|
1521
|
-
type: i0.Component,
|
|
1522
|
-
args: [{
|
|
1523
|
-
selector: 'igo-auth-form',
|
|
1524
|
-
templateUrl: './auth-form.component.html',
|
|
1525
|
-
styleUrls: ['./auth-form.component.scss'],
|
|
1526
|
-
changeDetection: i0.ChangeDetectionStrategy.Default
|
|
1527
|
-
}]
|
|
1528
|
-
}], function () {
|
|
1529
|
-
return [{ type: AuthService }, { type: i2__namespace.ConfigService }, { type: i3__namespace.Router, decorators: [{
|
|
1530
|
-
type: i0.Optional
|
|
1531
|
-
}] }];
|
|
1532
|
-
}, { backgroundDisable: [{
|
|
1533
|
-
type: i0.Input
|
|
1534
|
-
}], hasAlreadyConnectedDiv: [{
|
|
1535
|
-
type: i0.Input
|
|
1536
|
-
}], hasLogoutDiv: [{
|
|
1537
|
-
type: i0.Input
|
|
1538
|
-
}], showAlreadyConnectedDiv: [{
|
|
1539
|
-
type: i0.Input
|
|
1540
|
-
}], showLogoutDiv: [{
|
|
1541
|
-
type: i0.Input
|
|
1542
|
-
}], login: [{
|
|
1543
|
-
type: i0.Output
|
|
1544
|
-
}] });
|
|
1545
|
-
})();
|
|
1546
|
-
|
|
1547
|
-
var LoggedGuard = /** @class */ (function () {
|
|
1548
|
-
function LoggedGuard(authService, config, router) {
|
|
1549
|
-
this.authService = authService;
|
|
1550
|
-
this.config = config;
|
|
1551
|
-
this.router = router;
|
|
1552
|
-
}
|
|
1553
|
-
LoggedGuard.prototype.canActivate = function (route, state) {
|
|
1554
|
-
if (this.authService.logged) {
|
|
1555
|
-
return true;
|
|
1556
|
-
}
|
|
1557
|
-
this.authService.redirectUrl = state.url;
|
|
1558
|
-
var authConfig = this.config.getConfig('auth');
|
|
1559
|
-
if (authConfig && authConfig.loginRoute) {
|
|
1560
|
-
this.router.navigateByUrl(authConfig.loginRoute);
|
|
1561
|
-
}
|
|
1562
|
-
return false;
|
|
1563
|
-
};
|
|
1564
|
-
return LoggedGuard;
|
|
1565
|
-
}());
|
|
1566
|
-
LoggedGuard.ɵfac = function LoggedGuard_Factory(t) { return new (t || LoggedGuard)(i0__namespace.ɵɵinject(AuthService), i0__namespace.ɵɵinject(i2__namespace.ConfigService), i0__namespace.ɵɵinject(i3__namespace.Router)); };
|
|
1567
|
-
LoggedGuard.ɵprov = /*@__PURE__*/ i0__namespace.ɵɵdefineInjectable({ token: LoggedGuard, factory: LoggedGuard.ɵfac, providedIn: 'root' });
|
|
1568
|
-
(function () {
|
|
1569
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(LoggedGuard, [{
|
|
1570
|
-
type: i0.Injectable,
|
|
1571
|
-
args: [{
|
|
1572
|
-
providedIn: 'root'
|
|
1573
|
-
}]
|
|
1574
|
-
}], function () { return [{ type: AuthService }, { type: i2__namespace.ConfigService }, { type: i3__namespace.Router }]; }, null);
|
|
1575
|
-
})();
|
|
1576
|
-
|
|
1577
|
-
var AuthGuard = /** @class */ (function () {
|
|
1578
|
-
function AuthGuard(authService, config, router) {
|
|
1579
|
-
this.authService = authService;
|
|
1580
|
-
this.config = config;
|
|
1581
|
-
this.router = router;
|
|
1582
|
-
}
|
|
1583
|
-
AuthGuard.prototype.canActivate = function (route, state) {
|
|
1584
|
-
if (this.authService.authenticated) {
|
|
1585
|
-
return true;
|
|
1586
|
-
}
|
|
1587
|
-
this.authService.redirectUrl = state.url;
|
|
1588
|
-
var authConfig = this.config.getConfig('auth');
|
|
1589
|
-
if (authConfig && authConfig.loginRoute) {
|
|
1590
|
-
this.router.navigateByUrl(authConfig.loginRoute);
|
|
1591
|
-
}
|
|
1592
|
-
return false;
|
|
1593
|
-
};
|
|
1594
|
-
return AuthGuard;
|
|
1595
|
-
}());
|
|
1596
|
-
AuthGuard.ɵfac = function AuthGuard_Factory(t) { return new (t || AuthGuard)(i0__namespace.ɵɵinject(AuthService), i0__namespace.ɵɵinject(i2__namespace.ConfigService), i0__namespace.ɵɵinject(i3__namespace.Router)); };
|
|
1597
|
-
AuthGuard.ɵprov = /*@__PURE__*/ i0__namespace.ɵɵdefineInjectable({ token: AuthGuard, factory: AuthGuard.ɵfac, providedIn: 'root' });
|
|
1598
|
-
(function () {
|
|
1599
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(AuthGuard, [{
|
|
1600
|
-
type: i0.Injectable,
|
|
1601
|
-
args: [{
|
|
1602
|
-
providedIn: 'root'
|
|
1603
|
-
}]
|
|
1604
|
-
}], function () { return [{ type: AuthService }, { type: i2__namespace.ConfigService }, { type: i3__namespace.Router }]; }, null);
|
|
1605
|
-
})();
|
|
1606
|
-
|
|
1607
|
-
var AdminGuard = /** @class */ (function () {
|
|
1608
|
-
function AdminGuard(authService, config, router) {
|
|
1609
|
-
this.authService = authService;
|
|
1610
|
-
this.config = config;
|
|
1611
|
-
this.router = router;
|
|
1612
|
-
}
|
|
1613
|
-
AdminGuard.prototype.canActivate = function (route, state) {
|
|
1614
|
-
var token = this.authService.decodeToken();
|
|
1615
|
-
if (token && token.user && token.user.isAdmin) {
|
|
1616
|
-
return true;
|
|
1617
|
-
}
|
|
1618
|
-
this.authService.redirectUrl = state.url;
|
|
1619
|
-
var authConfig = this.config.getConfig('auth');
|
|
1620
|
-
if (authConfig && authConfig.loginRoute) {
|
|
1621
|
-
this.router.navigateByUrl(authConfig.loginRoute);
|
|
1622
|
-
}
|
|
1623
|
-
return false;
|
|
1624
|
-
};
|
|
1625
|
-
return AdminGuard;
|
|
1626
|
-
}());
|
|
1627
|
-
AdminGuard.ɵfac = function AdminGuard_Factory(t) { return new (t || AdminGuard)(i0__namespace.ɵɵinject(AuthService), i0__namespace.ɵɵinject(i2__namespace.ConfigService), i0__namespace.ɵɵinject(i3__namespace.Router)); };
|
|
1628
|
-
AdminGuard.ɵprov = /*@__PURE__*/ i0__namespace.ɵɵdefineInjectable({ token: AdminGuard, factory: AdminGuard.ɵfac, providedIn: 'root' });
|
|
1629
|
-
(function () {
|
|
1630
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(AdminGuard, [{
|
|
1631
|
-
type: i0.Injectable,
|
|
1632
|
-
args: [{
|
|
1633
|
-
providedIn: 'root'
|
|
1634
|
-
}]
|
|
1635
|
-
}], function () { return [{ type: AuthService }, { type: i2__namespace.ConfigService }, { type: i3__namespace.Router }]; }, null);
|
|
1636
|
-
})();
|
|
1637
|
-
|
|
1638
|
-
var ProfilsGuard = /** @class */ (function () {
|
|
1639
|
-
function ProfilsGuard(authService, config, router) {
|
|
1640
|
-
this.authService = authService;
|
|
1641
|
-
this.config = config;
|
|
1642
|
-
this.router = router;
|
|
1643
|
-
}
|
|
1644
|
-
ProfilsGuard.prototype.canActivate = function (_route, state) {
|
|
1645
|
-
var _this = this;
|
|
1646
|
-
return this.authService.getProfils().pipe(operators.map(function (profils) {
|
|
1647
|
-
var authConfig = _this.config.getConfig('auth');
|
|
1648
|
-
if (profils &&
|
|
1649
|
-
profils.profils &&
|
|
1650
|
-
profils.profils.some(function (v) { return authConfig.profilsGuard.indexOf(v) !== -1; })) {
|
|
1651
|
-
return true;
|
|
1652
|
-
}
|
|
1653
|
-
_this.authService.redirectUrl = state.url;
|
|
1654
|
-
if (authConfig && authConfig.loginRoute) {
|
|
1655
|
-
_this.router.navigateByUrl(authConfig.loginRoute);
|
|
1656
|
-
}
|
|
1657
|
-
return false;
|
|
1658
|
-
}));
|
|
1659
|
-
};
|
|
1660
|
-
return ProfilsGuard;
|
|
1661
|
-
}());
|
|
1662
|
-
ProfilsGuard.ɵfac = function ProfilsGuard_Factory(t) { return new (t || ProfilsGuard)(i0__namespace.ɵɵinject(AuthService), i0__namespace.ɵɵinject(i2__namespace.ConfigService), i0__namespace.ɵɵinject(i3__namespace.Router)); };
|
|
1663
|
-
ProfilsGuard.ɵprov = /*@__PURE__*/ i0__namespace.ɵɵdefineInjectable({ token: ProfilsGuard, factory: ProfilsGuard.ɵfac, providedIn: 'root' });
|
|
1664
|
-
(function () {
|
|
1665
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(ProfilsGuard, [{
|
|
1666
|
-
type: i0.Injectable,
|
|
1667
|
-
args: [{
|
|
1668
|
-
providedIn: 'root'
|
|
1669
|
-
}]
|
|
1670
|
-
}], function () { return [{ type: AuthService }, { type: i2__namespace.ConfigService }, { type: i3__namespace.Router }]; }, null);
|
|
1671
|
-
})();
|
|
1672
|
-
|
|
1673
|
-
var AuthInterceptor = /** @class */ (function () {
|
|
1674
|
-
function AuthInterceptor(config, tokenService, http) {
|
|
1675
|
-
this.config = config;
|
|
1676
|
-
this.tokenService = tokenService;
|
|
1677
|
-
this.http = http;
|
|
1678
|
-
this.refreshInProgress = false;
|
|
1679
|
-
}
|
|
1680
|
-
Object.defineProperty(AuthInterceptor.prototype, "trustHosts", {
|
|
1681
|
-
get: function () {
|
|
1682
|
-
var trustHosts = this.config.getConfig('auth.trustHosts') || [];
|
|
1683
|
-
trustHosts.push(window.location.hostname);
|
|
1684
|
-
return trustHosts;
|
|
1685
|
-
},
|
|
1686
|
-
enumerable: false,
|
|
1687
|
-
configurable: true
|
|
1688
|
-
});
|
|
1689
|
-
Object.defineProperty(AuthInterceptor.prototype, "hostsWithCredentials", {
|
|
1690
|
-
get: function () {
|
|
1691
|
-
return this.config.getConfig('auth.hostsWithCredentials') || [];
|
|
1692
|
-
},
|
|
1693
|
-
enumerable: false,
|
|
1694
|
-
configurable: true
|
|
1695
|
-
});
|
|
1696
|
-
Object.defineProperty(AuthInterceptor.prototype, "hostsWithAuthByKey", {
|
|
1697
|
-
get: function () {
|
|
1698
|
-
return this.config.getConfig('auth.hostsByKey') || [];
|
|
1699
|
-
},
|
|
1700
|
-
enumerable: false,
|
|
1701
|
-
configurable: true
|
|
1702
|
-
});
|
|
1703
|
-
AuthInterceptor.prototype.intercept = function (originalReq, next) {
|
|
1704
|
-
var withCredentials = this.handleHostsWithCredentials(originalReq.url);
|
|
1705
|
-
var req = originalReq.clone();
|
|
1706
|
-
var hostWithKey = this.handleHostsAuthByKey(originalReq.url);
|
|
1707
|
-
if (hostWithKey) {
|
|
1708
|
-
req = req.clone({
|
|
1709
|
-
params: req.params.set(hostWithKey.key, hostWithKey.value)
|
|
1710
|
-
});
|
|
1711
|
-
}
|
|
1712
|
-
if (withCredentials) {
|
|
1713
|
-
req = originalReq.clone({
|
|
1714
|
-
withCredentials: withCredentials
|
|
1715
|
-
});
|
|
1716
|
-
}
|
|
1717
|
-
this.refreshToken();
|
|
1718
|
-
var token = this.tokenService.get();
|
|
1719
|
-
var element = document.createElement('a');
|
|
1720
|
-
element.href = req.url;
|
|
1721
|
-
if (element.host === '') {
|
|
1722
|
-
element.href = element.href; // FIX IE11, DO NOT REMOVE
|
|
1723
|
-
}
|
|
1724
|
-
if (!token || this.trustHosts.indexOf(element.hostname) === -1) {
|
|
1725
|
-
return next.handle(req);
|
|
1726
|
-
}
|
|
1727
|
-
var authHeader = "Bearer " + token;
|
|
1728
|
-
var authReq = req.clone({
|
|
1729
|
-
headers: req.headers.set('Authorization', authHeader)
|
|
1730
|
-
});
|
|
1731
|
-
var tokenDecoded = this.tokenService.decode();
|
|
1732
|
-
if (authReq.params.get('_i') === 'true' &&
|
|
1733
|
-
tokenDecoded &&
|
|
1734
|
-
tokenDecoded.user &&
|
|
1735
|
-
tokenDecoded.user.sourceId) {
|
|
1736
|
-
var hashUser = tsMd5.Md5.hashStr(tokenDecoded.user.sourceId);
|
|
1737
|
-
authReq = authReq.clone({
|
|
1738
|
-
params: authReq.params.set('_i', hashUser)
|
|
1739
|
-
});
|
|
1740
|
-
}
|
|
1741
|
-
else if (authReq.params.get('_i') === 'true') {
|
|
1742
|
-
authReq = authReq.clone({
|
|
1743
|
-
params: authReq.params.delete('_i')
|
|
1744
|
-
});
|
|
1745
|
-
}
|
|
1746
|
-
return next.handle(authReq);
|
|
1747
|
-
};
|
|
1748
|
-
AuthInterceptor.prototype.interceptXhr = function (xhr, url) {
|
|
1749
|
-
var withCredentials = this.handleHostsWithCredentials(url);
|
|
1750
|
-
if (withCredentials) {
|
|
1751
|
-
xhr.withCredentials = withCredentials;
|
|
1752
|
-
return true;
|
|
1753
|
-
}
|
|
1754
|
-
this.refreshToken();
|
|
1755
|
-
var element = document.createElement('a');
|
|
1756
|
-
element.href = url;
|
|
1757
|
-
var token = this.tokenService.get();
|
|
1758
|
-
if (!token || this.trustHosts.indexOf(element.hostname) === -1) {
|
|
1759
|
-
return false;
|
|
1760
|
-
}
|
|
1761
|
-
xhr.setRequestHeader('Authorization', 'Bearer ' + token);
|
|
1762
|
-
return true;
|
|
1763
|
-
};
|
|
1764
|
-
AuthInterceptor.prototype.alterUrlWithKeyAuth = function (url) {
|
|
1765
|
-
var hostWithKey = this.handleHostsAuthByKey(url);
|
|
1766
|
-
var interceptedUrl = url;
|
|
1767
|
-
if (hostWithKey) {
|
|
1768
|
-
var urlDecomposed = interceptedUrl.split(/[?&]/);
|
|
1769
|
-
var urlWithKeyAdded = urlDecomposed.shift();
|
|
1770
|
-
var paramsToKeep = urlDecomposed.filter(function (p) { return p.length !== 0; });
|
|
1771
|
-
paramsToKeep.push(hostWithKey.key + "=" + hostWithKey.value);
|
|
1772
|
-
if (paramsToKeep.length) {
|
|
1773
|
-
urlWithKeyAdded += '?' + paramsToKeep.join('&');
|
|
1774
|
-
}
|
|
1775
|
-
return urlWithKeyAdded;
|
|
1776
|
-
}
|
|
1777
|
-
return;
|
|
1778
|
-
};
|
|
1779
|
-
AuthInterceptor.prototype.handleHostsWithCredentials = function (reqUrl) {
|
|
1780
|
-
var e_1, _a;
|
|
1781
|
-
var withCredentials = false;
|
|
1782
|
-
try {
|
|
1783
|
-
for (var _b = __values(this.hostsWithCredentials), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1784
|
-
var hostWithCredentials = _c.value;
|
|
1785
|
-
var domainRegex = new RegExp(hostWithCredentials.domainRegFilters);
|
|
1786
|
-
if (domainRegex.test(reqUrl)) {
|
|
1787
|
-
withCredentials = hostWithCredentials.withCredentials !== undefined ? hostWithCredentials.withCredentials : undefined;
|
|
1788
|
-
break;
|
|
1789
|
-
}
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1793
|
-
finally {
|
|
1794
|
-
try {
|
|
1795
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1796
|
-
}
|
|
1797
|
-
finally { if (e_1) throw e_1.error; }
|
|
1798
|
-
}
|
|
1799
|
-
return withCredentials;
|
|
1800
|
-
};
|
|
1801
|
-
AuthInterceptor.prototype.handleHostsAuthByKey = function (reqUrl) {
|
|
1802
|
-
var e_2, _a;
|
|
1803
|
-
var hostWithKey;
|
|
1804
|
-
try {
|
|
1805
|
-
for (var _b = __values(this.hostsWithAuthByKey), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1806
|
-
var hostWithAuthByKey = _c.value;
|
|
1807
|
-
var domainRegex = new RegExp(hostWithAuthByKey.domainRegFilters);
|
|
1808
|
-
if (domainRegex.test(reqUrl)) {
|
|
1809
|
-
var replace = hostWithAuthByKey.keyProperty + "=" + hostWithAuthByKey.keyValue;
|
|
1810
|
-
var keyAdded = new RegExp(replace, "gm");
|
|
1811
|
-
if (!keyAdded.test(reqUrl)) {
|
|
1812
|
-
hostWithKey = { key: hostWithAuthByKey.keyProperty, value: hostWithAuthByKey.keyValue };
|
|
1813
|
-
break;
|
|
1814
|
-
}
|
|
1815
|
-
}
|
|
1816
|
-
}
|
|
1817
|
-
}
|
|
1818
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1819
|
-
finally {
|
|
1820
|
-
try {
|
|
1821
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1822
|
-
}
|
|
1823
|
-
finally { if (e_2) throw e_2.error; }
|
|
1824
|
-
}
|
|
1825
|
-
return hostWithKey;
|
|
1826
|
-
};
|
|
1827
|
-
AuthInterceptor.prototype.refreshToken = function () {
|
|
1828
|
-
var _this = this;
|
|
1829
|
-
var jwt = this.tokenService.decode();
|
|
1830
|
-
var currentTime = new Date().getTime() / 1000;
|
|
1831
|
-
if (!this.refreshInProgress &&
|
|
1832
|
-
jwt &&
|
|
1833
|
-
currentTime < jwt.exp &&
|
|
1834
|
-
currentTime > jwt.exp - 1800) {
|
|
1835
|
-
this.refreshInProgress = true;
|
|
1836
|
-
var url = this.config.getConfig('auth.url');
|
|
1837
|
-
return this.http.post(url + "/refresh", {}).subscribe(function (data) {
|
|
1838
|
-
_this.tokenService.set(data.token);
|
|
1839
|
-
_this.refreshInProgress = false;
|
|
1840
|
-
}, function (err) {
|
|
1841
|
-
err.error.caught = true;
|
|
1842
|
-
return err;
|
|
1843
|
-
});
|
|
1844
|
-
}
|
|
1845
|
-
};
|
|
1846
|
-
return AuthInterceptor;
|
|
1847
|
-
}());
|
|
1848
|
-
AuthInterceptor.ɵfac = function AuthInterceptor_Factory(t) { return new (t || AuthInterceptor)(i0__namespace.ɵɵinject(i2__namespace.ConfigService), i0__namespace.ɵɵinject(TokenService), i0__namespace.ɵɵinject(i1__namespace.HttpClient)); };
|
|
1849
|
-
AuthInterceptor.ɵprov = /*@__PURE__*/ i0__namespace.ɵɵdefineInjectable({ token: AuthInterceptor, factory: AuthInterceptor.ɵfac, providedIn: 'root' });
|
|
1850
|
-
(function () {
|
|
1851
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(AuthInterceptor, [{
|
|
1852
|
-
type: i0.Injectable,
|
|
1853
|
-
args: [{
|
|
1854
|
-
providedIn: 'root'
|
|
1855
|
-
}]
|
|
1856
|
-
}], function () { return [{ type: i2__namespace.ConfigService }, { type: TokenService }, { type: i1__namespace.HttpClient }]; }, null);
|
|
1857
|
-
})();
|
|
1858
|
-
|
|
1859
|
-
function MSALConfigFactory(config) {
|
|
1860
|
-
var msConf = config.getConfig('auth.microsoft') || {};
|
|
1861
|
-
msConf.redirectUri = msConf.redirectUri || window.location.href;
|
|
1862
|
-
msConf.authority = msConf.authority || 'https://login.microsoftonline.com/organizations';
|
|
1863
|
-
var myMsalObj = new msalBrowser.PublicClientApplication({
|
|
1864
|
-
auth: msConf,
|
|
1865
|
-
cache: {
|
|
1866
|
-
cacheLocation: 'sessionStorage'
|
|
1867
|
-
}
|
|
1868
|
-
});
|
|
1869
|
-
return myMsalObj;
|
|
1870
|
-
}
|
|
1871
|
-
function MSALConfigFactoryb2c(config) {
|
|
1872
|
-
var msConf = config.getConfig('auth.microsoftb2c.browserAuthOptions') || {};
|
|
1873
|
-
msConf.redirectUri = msConf.redirectUri || window.location.href;
|
|
1874
|
-
msConf.authority = msConf.authority || 'https://login.microsoftonline.com/organizations';
|
|
1875
|
-
var myMsalObj = new msalBrowser.PublicClientApplication({
|
|
1876
|
-
auth: msConf,
|
|
1877
|
-
cache: {
|
|
1878
|
-
cacheLocation: 'sessionStorage'
|
|
1879
|
-
}
|
|
1880
|
-
});
|
|
1881
|
-
return myMsalObj;
|
|
1882
|
-
}
|
|
1883
|
-
function MSALAngularConfigFactory(config) {
|
|
1884
|
-
var msConf = config.getConfig('auth.microsoft') || {};
|
|
1885
|
-
return {
|
|
1886
|
-
interactionType: msalBrowser.InteractionType.Popup,
|
|
1887
|
-
authRequest: {
|
|
1888
|
-
scopes: ['user.read'],
|
|
1889
|
-
loginHint: 'todo',
|
|
1890
|
-
},
|
|
1891
|
-
type: 'add'
|
|
1892
|
-
};
|
|
1893
|
-
}
|
|
1894
|
-
function MSALAngularConfigFactoryb2c(config) {
|
|
1895
|
-
var msConf = config.getConfig('auth.microsoftb2c.browserAuthOptions') || {};
|
|
1896
|
-
return {
|
|
1897
|
-
interactionType: msalBrowser.InteractionType.Popup,
|
|
1898
|
-
authRequest: {
|
|
1899
|
-
scopes: [msConf.clientId]
|
|
1900
|
-
},
|
|
1901
|
-
type: 'b2c'
|
|
1902
|
-
};
|
|
1903
|
-
}
|
|
1904
|
-
function provideAuthMicrosoft(type) {
|
|
1905
|
-
if (type === 'b2c') {
|
|
1906
|
-
return [
|
|
1907
|
-
{
|
|
1908
|
-
provide: i3$1.MSAL_INSTANCE,
|
|
1909
|
-
useFactory: MSALConfigFactoryb2c,
|
|
1910
|
-
deps: [i2.ConfigService]
|
|
1911
|
-
},
|
|
1912
|
-
{
|
|
1913
|
-
provide: i3$1.MSAL_GUARD_CONFIG,
|
|
1914
|
-
useFactory: MSALAngularConfigFactoryb2c,
|
|
1915
|
-
deps: [i2.ConfigService],
|
|
1916
|
-
multi: true
|
|
1917
|
-
},
|
|
1918
|
-
MsalServiceb2c
|
|
1919
|
-
];
|
|
1920
|
-
}
|
|
1921
|
-
else {
|
|
1922
|
-
return [
|
|
1923
|
-
{
|
|
1924
|
-
provide: i3$1.MSAL_INSTANCE,
|
|
1925
|
-
useFactory: MSALConfigFactory,
|
|
1926
|
-
deps: [i2.ConfigService]
|
|
1927
|
-
},
|
|
1928
|
-
{
|
|
1929
|
-
provide: i3$1.MSAL_GUARD_CONFIG,
|
|
1930
|
-
useFactory: MSALAngularConfigFactory,
|
|
1931
|
-
deps: [i2.ConfigService],
|
|
1932
|
-
multi: true
|
|
1933
|
-
},
|
|
1934
|
-
i3$1.MsalService
|
|
1935
|
-
];
|
|
1936
|
-
}
|
|
1937
|
-
}
|
|
1938
|
-
|
|
1939
|
-
var ProtectedDirective = /** @class */ (function () {
|
|
1940
|
-
function ProtectedDirective(authentication, el) {
|
|
1941
|
-
if (!authentication.isAuthenticated()) {
|
|
1942
|
-
el.nativeElement.parentNode.removeChild(el.nativeElement);
|
|
1943
|
-
}
|
|
1944
|
-
}
|
|
1945
|
-
return ProtectedDirective;
|
|
1946
|
-
}());
|
|
1947
|
-
ProtectedDirective.ɵfac = function ProtectedDirective_Factory(t) { return new (t || ProtectedDirective)(i0__namespace.ɵɵdirectiveInject(AuthService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ElementRef)); };
|
|
1948
|
-
ProtectedDirective.ɵdir = /*@__PURE__*/ i0__namespace.ɵɵdefineDirective({ type: ProtectedDirective, selectors: [["", "igoProtected", ""]] });
|
|
1949
|
-
(function () {
|
|
1950
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(ProtectedDirective, [{
|
|
1951
|
-
type: i0.Directive,
|
|
1952
|
-
args: [{
|
|
1953
|
-
selector: '[igoProtected]'
|
|
1954
|
-
}]
|
|
1955
|
-
}], function () { return [{ type: AuthService }, { type: i0__namespace.ElementRef }]; }, null);
|
|
1956
|
-
})();
|
|
1957
|
-
|
|
1958
|
-
var AuthStorageService = /** @class */ (function (_super) {
|
|
1959
|
-
__extends(AuthStorageService, _super);
|
|
1960
|
-
function AuthStorageService(config, http, authService, tokenService) {
|
|
1961
|
-
var _this = _super.call(this, config) || this;
|
|
1962
|
-
_this.http = http;
|
|
1963
|
-
_this.authService = authService;
|
|
1964
|
-
_this.tokenService = tokenService;
|
|
1965
|
-
_this.authService.authenticate$.subscribe(function (isAuthenticated) {
|
|
1966
|
-
if (isAuthenticated && _this.options.url) {
|
|
1967
|
-
_this.http
|
|
1968
|
-
.get(_this.options.url)
|
|
1969
|
-
.subscribe(function (userIgo) {
|
|
1970
|
-
var e_1, _a;
|
|
1971
|
-
if (userIgo && userIgo.preference) {
|
|
1972
|
-
try {
|
|
1973
|
-
for (var _b = __values(Object.keys(userIgo.preference)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1974
|
-
var key = _c.value;
|
|
1975
|
-
var value = userIgo.preference[key];
|
|
1976
|
-
_super.prototype.set.call(_this, key, value);
|
|
1977
|
-
}
|
|
1978
|
-
}
|
|
1979
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1980
|
-
finally {
|
|
1981
|
-
try {
|
|
1982
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1983
|
-
}
|
|
1984
|
-
finally { if (e_1) throw e_1.error; }
|
|
1985
|
-
}
|
|
1986
|
-
}
|
|
1987
|
-
});
|
|
1988
|
-
}
|
|
1989
|
-
});
|
|
1990
|
-
return _this;
|
|
1991
|
-
}
|
|
1992
|
-
AuthStorageService.prototype.set = function (key, value, scope) {
|
|
1993
|
-
if (scope === void 0) { scope = i2.StorageScope.LOCAL; }
|
|
1994
|
-
if (scope === i2.StorageScope.LOCAL &&
|
|
1995
|
-
this.authService.authenticated &&
|
|
1996
|
-
this.options.url) {
|
|
1997
|
-
var preference = {};
|
|
1998
|
-
preference[key] = value;
|
|
1999
|
-
this.http.patch(this.options.url, { preference: preference }).subscribe();
|
|
2000
|
-
}
|
|
2001
|
-
_super.prototype.set.call(this, key, value, scope);
|
|
2002
|
-
};
|
|
2003
|
-
AuthStorageService.prototype.remove = function (key, scope) {
|
|
2004
|
-
if (scope === void 0) { scope = i2.StorageScope.LOCAL; }
|
|
2005
|
-
if (scope === i2.StorageScope.LOCAL &&
|
|
2006
|
-
this.authService.authenticated &&
|
|
2007
|
-
this.options.url) {
|
|
2008
|
-
var preference = {};
|
|
2009
|
-
preference[key] = undefined;
|
|
2010
|
-
this.http.patch(this.options.url, { preference: preference }).subscribe();
|
|
2011
|
-
}
|
|
2012
|
-
_super.prototype.remove.call(this, key, scope);
|
|
2013
|
-
};
|
|
2014
|
-
AuthStorageService.prototype.clear = function (scope) {
|
|
2015
|
-
var _this = this;
|
|
2016
|
-
if (scope === void 0) { scope = i2.StorageScope.LOCAL; }
|
|
2017
|
-
if (scope === i2.StorageScope.LOCAL &&
|
|
2018
|
-
this.authService.authenticated &&
|
|
2019
|
-
this.options.url) {
|
|
2020
|
-
this.http.patch(this.options.url, { preference: {} }, {
|
|
2021
|
-
params: {
|
|
2022
|
-
mergePreference: 'false'
|
|
2023
|
-
}
|
|
2024
|
-
}).subscribe();
|
|
2025
|
-
}
|
|
2026
|
-
var token;
|
|
2027
|
-
if (scope === i2.StorageScope.LOCAL) {
|
|
2028
|
-
token = this.tokenService.get();
|
|
2029
|
-
}
|
|
2030
|
-
_super.prototype.clear.call(this, scope);
|
|
2031
|
-
if (token) {
|
|
2032
|
-
this.tokenService.set(token);
|
|
2033
|
-
}
|
|
2034
|
-
if (scope === i2.StorageScope.LOCAL &&
|
|
2035
|
-
this.authService.authenticated &&
|
|
2036
|
-
this.options.url) {
|
|
2037
|
-
this.http
|
|
2038
|
-
.get(this.options.url)
|
|
2039
|
-
.subscribe(function (userIgo) {
|
|
2040
|
-
var e_2, _a;
|
|
2041
|
-
if (userIgo && userIgo.preference) {
|
|
2042
|
-
try {
|
|
2043
|
-
for (var _b = __values(Object.keys(userIgo.preference)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2044
|
-
var key = _c.value;
|
|
2045
|
-
var value = userIgo.preference[key];
|
|
2046
|
-
_super.prototype.set.call(_this, key, value);
|
|
2047
|
-
}
|
|
2048
|
-
}
|
|
2049
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
2050
|
-
finally {
|
|
2051
|
-
try {
|
|
2052
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2053
|
-
}
|
|
2054
|
-
finally { if (e_2) throw e_2.error; }
|
|
2055
|
-
}
|
|
2056
|
-
}
|
|
2057
|
-
});
|
|
2058
|
-
}
|
|
2059
|
-
};
|
|
2060
|
-
return AuthStorageService;
|
|
2061
|
-
}(i2.StorageService));
|
|
2062
|
-
AuthStorageService.ɵfac = function AuthStorageService_Factory(t) { return new (t || AuthStorageService)(i0__namespace.ɵɵinject(i2__namespace.ConfigService), i0__namespace.ɵɵinject(i1__namespace.HttpClient), i0__namespace.ɵɵinject(AuthService), i0__namespace.ɵɵinject(TokenService)); };
|
|
2063
|
-
AuthStorageService.ɵprov = /*@__PURE__*/ i0__namespace.ɵɵdefineInjectable({ token: AuthStorageService, factory: AuthStorageService.ɵfac, providedIn: 'root' });
|
|
2064
|
-
(function () {
|
|
2065
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(AuthStorageService, [{
|
|
2066
|
-
type: i0.Injectable,
|
|
2067
|
-
args: [{
|
|
2068
|
-
providedIn: 'root'
|
|
2069
|
-
}]
|
|
2070
|
-
}], function () { return [{ type: i2__namespace.ConfigService }, { type: i1__namespace.HttpClient }, { type: AuthService }, { type: TokenService }]; }, null);
|
|
2071
|
-
})();
|
|
2072
|
-
|
|
2073
|
-
var routes = [
|
|
2074
|
-
{ path: 'login', component: AuthFormComponent },
|
|
2075
|
-
{ path: 'logout', component: AuthFormComponent }
|
|
2076
|
-
];
|
|
2077
|
-
var AuthRoutingModule = /** @class */ (function () {
|
|
2078
|
-
function AuthRoutingModule() {
|
|
2079
|
-
}
|
|
2080
|
-
return AuthRoutingModule;
|
|
2081
|
-
}());
|
|
2082
|
-
AuthRoutingModule.ɵfac = function AuthRoutingModule_Factory(t) { return new (t || AuthRoutingModule)(); };
|
|
2083
|
-
AuthRoutingModule.ɵmod = /*@__PURE__*/ i0__namespace.ɵɵdefineNgModule({ type: AuthRoutingModule });
|
|
2084
|
-
AuthRoutingModule.ɵinj = /*@__PURE__*/ i0__namespace.ɵɵdefineInjector({ providers: [], imports: [[i3.RouterModule.forChild(routes)], i3.RouterModule] });
|
|
2085
|
-
(function () {
|
|
2086
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(AuthRoutingModule, [{
|
|
2087
|
-
type: i0.NgModule,
|
|
2088
|
-
args: [{
|
|
2089
|
-
imports: [i3.RouterModule.forChild(routes)],
|
|
2090
|
-
exports: [i3.RouterModule],
|
|
2091
|
-
providers: []
|
|
2092
|
-
}]
|
|
2093
|
-
}], null, null);
|
|
2094
|
-
})();
|
|
2095
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0__namespace.ɵɵsetNgModuleScope(AuthRoutingModule, { imports: [i3__namespace.RouterModule], exports: [i3.RouterModule] }); })();
|
|
2096
|
-
|
|
2097
|
-
var IgoAuthModule = /** @class */ (function () {
|
|
2098
|
-
function IgoAuthModule() {
|
|
2099
|
-
}
|
|
2100
|
-
IgoAuthModule.forRoot = function () {
|
|
2101
|
-
return {
|
|
2102
|
-
ngModule: IgoAuthModule,
|
|
2103
|
-
providers: __spreadArray(__spreadArray([
|
|
2104
|
-
{
|
|
2105
|
-
provide: i1.HTTP_INTERCEPTORS,
|
|
2106
|
-
useClass: AuthInterceptor,
|
|
2107
|
-
multi: true
|
|
2108
|
-
},
|
|
2109
|
-
{
|
|
2110
|
-
provide: i2.StorageService,
|
|
2111
|
-
useClass: AuthStorageService
|
|
2112
|
-
}
|
|
2113
|
-
], __read(provideAuthMicrosoft('add'))), __read(provideAuthMicrosoft('b2c')))
|
|
2114
|
-
};
|
|
2115
|
-
};
|
|
2116
|
-
return IgoAuthModule;
|
|
2117
|
-
}());
|
|
2118
|
-
IgoAuthModule.ɵfac = function IgoAuthModule_Factory(t) { return new (t || IgoAuthModule)(); };
|
|
2119
|
-
IgoAuthModule.ɵmod = /*@__PURE__*/ i0__namespace.ɵɵdefineNgModule({ type: IgoAuthModule });
|
|
2120
|
-
IgoAuthModule.ɵinj = /*@__PURE__*/ i0__namespace.ɵɵdefineInjector({ imports: [[
|
|
2121
|
-
i1$1.CommonModule,
|
|
2122
|
-
i3$2.ReactiveFormsModule,
|
|
2123
|
-
i4$1.MatFormFieldModule,
|
|
2124
|
-
i5$1.MatInputModule,
|
|
2125
|
-
i5.MatIconModule,
|
|
2126
|
-
i4.MatButtonModule,
|
|
2127
|
-
i2.IgoLanguageModule,
|
|
2128
|
-
i3$1.MsalModule
|
|
2129
|
-
]] });
|
|
2130
|
-
(function () {
|
|
2131
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(IgoAuthModule, [{
|
|
2132
|
-
type: i0.NgModule,
|
|
2133
|
-
args: [{
|
|
2134
|
-
imports: [
|
|
2135
|
-
i1$1.CommonModule,
|
|
2136
|
-
i3$2.ReactiveFormsModule,
|
|
2137
|
-
i4$1.MatFormFieldModule,
|
|
2138
|
-
i5$1.MatInputModule,
|
|
2139
|
-
i5.MatIconModule,
|
|
2140
|
-
i4.MatButtonModule,
|
|
2141
|
-
i2.IgoLanguageModule,
|
|
2142
|
-
i3$1.MsalModule
|
|
2143
|
-
],
|
|
2144
|
-
declarations: [
|
|
2145
|
-
AuthFormComponent,
|
|
2146
|
-
AuthGoogleComponent,
|
|
2147
|
-
AuthInternComponent,
|
|
2148
|
-
AuthFacebookComponent,
|
|
2149
|
-
AuthMicrosoftComponent,
|
|
2150
|
-
AuthMicrosoftb2cComponent,
|
|
2151
|
-
ProtectedDirective
|
|
2152
|
-
],
|
|
2153
|
-
exports: [AuthFormComponent, ProtectedDirective]
|
|
2154
|
-
}]
|
|
2155
|
-
}], null, null);
|
|
2156
|
-
})();
|
|
2157
|
-
(function () {
|
|
2158
|
-
(typeof ngJitMode === "undefined" || ngJitMode) && i0__namespace.ɵɵsetNgModuleScope(IgoAuthModule, { declarations: [AuthFormComponent,
|
|
2159
|
-
AuthGoogleComponent,
|
|
2160
|
-
AuthInternComponent,
|
|
2161
|
-
AuthFacebookComponent,
|
|
2162
|
-
AuthMicrosoftComponent,
|
|
2163
|
-
AuthMicrosoftb2cComponent,
|
|
2164
|
-
ProtectedDirective], imports: [i1$1.CommonModule,
|
|
2165
|
-
i3$2.ReactiveFormsModule,
|
|
2166
|
-
i4$1.MatFormFieldModule,
|
|
2167
|
-
i5$1.MatInputModule,
|
|
2168
|
-
i5.MatIconModule,
|
|
2169
|
-
i4.MatButtonModule,
|
|
2170
|
-
i2.IgoLanguageModule,
|
|
2171
|
-
i3$1.MsalModule], exports: [AuthFormComponent, ProtectedDirective] });
|
|
2172
|
-
})();
|
|
2173
|
-
|
|
2174
|
-
/*
|
|
2175
|
-
* Public API Surface of auth
|
|
2176
|
-
*/
|
|
2177
|
-
|
|
2178
|
-
/**
|
|
2179
|
-
* Generated bundle index. Do not edit.
|
|
2180
|
-
*/
|
|
2181
|
-
|
|
2182
|
-
exports.AdminGuard = AdminGuard;
|
|
2183
|
-
exports.AuthFormComponent = AuthFormComponent;
|
|
2184
|
-
exports.AuthGuard = AuthGuard;
|
|
2185
|
-
exports.AuthInterceptor = AuthInterceptor;
|
|
2186
|
-
exports.AuthRoutingModule = AuthRoutingModule;
|
|
2187
|
-
exports.AuthService = AuthService;
|
|
2188
|
-
exports.AuthStorageService = AuthStorageService;
|
|
2189
|
-
exports.IgoAuthModule = IgoAuthModule;
|
|
2190
|
-
exports.LoggedGuard = LoggedGuard;
|
|
2191
|
-
exports.MSALAngularConfigFactory = MSALAngularConfigFactory;
|
|
2192
|
-
exports.MSALAngularConfigFactoryb2c = MSALAngularConfigFactoryb2c;
|
|
2193
|
-
exports.MSALConfigFactory = MSALConfigFactory;
|
|
2194
|
-
exports.MSALConfigFactoryb2c = MSALConfigFactoryb2c;
|
|
2195
|
-
exports.ProfilsGuard = ProfilsGuard;
|
|
2196
|
-
exports.ProtectedDirective = ProtectedDirective;
|
|
2197
|
-
exports.TokenService = TokenService;
|
|
2198
|
-
exports.provideAuthMicrosoft = provideAuthMicrosoft;
|
|
2199
|
-
|
|
2200
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2201
|
-
|
|
2202
|
-
}));
|
|
2203
|
-
//# sourceMappingURL=igo2-auth.umd.js.map
|