@valtimo/keycloak 4.15.2-next-main.15 → 4.15.3-next-main.16

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.
@@ -4,605 +4,621 @@
4
4
  (global = global || self, factory((global.valtimo = global.valtimo || {}, global.valtimo.keycloak = {}), global.ng.core, global.keycloakAngular, global.ng.router, global.ngxLogger, global.config, global.ng.common, global.rxjs, global.contract));
5
5
  }(this, (function (exports, i0, i2, i1, i3, i1$1, common, rxjs, contract) { 'use strict';
6
6
 
7
- var KeycloakOptionsService = /** @class */ (function () {
8
- function KeycloakOptionsService(configService) {
9
- this.configService = configService;
10
- this.valtimoKeycloakOptions = configService.config.authentication.options;
11
- }
12
- Object.defineProperty(KeycloakOptionsService.prototype, "keycloakOptions", {
13
- get: function () {
14
- return this.valtimoKeycloakOptions.keycloakOptions;
15
- },
16
- enumerable: false,
17
- configurable: true
18
- });
19
- Object.defineProperty(KeycloakOptionsService.prototype, "logoutRedirectUri", {
20
- get: function () {
21
- return this.valtimoKeycloakOptions.logoutRedirectUri;
22
- },
23
- enumerable: false,
24
- configurable: true
25
- });
26
- return KeycloakOptionsService;
27
- }());
28
- KeycloakOptionsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function KeycloakOptionsService_Factory() { return new KeycloakOptionsService(i0.ɵɵinject(i1$1.ConfigService)); }, token: KeycloakOptionsService, providedIn: "root" });
29
- KeycloakOptionsService.decorators = [
30
- { type: i0.Injectable, args: [{
31
- providedIn: 'root'
32
- },] }
33
- ];
34
- KeycloakOptionsService.ctorParameters = function () { return [
35
- { type: i1$1.ConfigService }
7
+ var KeycloakOptionsService = /** @class */ (function () {
8
+ function KeycloakOptionsService(configService) {
9
+ this.configService = configService;
10
+ this.valtimoKeycloakOptions = configService.config.authentication.options;
11
+ }
12
+ Object.defineProperty(KeycloakOptionsService.prototype, "keycloakOptions", {
13
+ get: function () {
14
+ return this.valtimoKeycloakOptions.keycloakOptions;
15
+ },
16
+ enumerable: false,
17
+ configurable: true
18
+ });
19
+ Object.defineProperty(KeycloakOptionsService.prototype, "logoutRedirectUri", {
20
+ get: function () {
21
+ return this.valtimoKeycloakOptions.logoutRedirectUri;
22
+ },
23
+ enumerable: false,
24
+ configurable: true
25
+ });
26
+ return KeycloakOptionsService;
27
+ }());
28
+ KeycloakOptionsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function KeycloakOptionsService_Factory() { return new KeycloakOptionsService(i0.ɵɵinject(i1$1.ConfigService)); }, token: KeycloakOptionsService, providedIn: "root" });
29
+ KeycloakOptionsService.decorators = [
30
+ { type: i0.Injectable, args: [{
31
+ providedIn: 'root',
32
+ },] }
33
+ ];
34
+ KeycloakOptionsService.ctorParameters = function () { return [
35
+ { type: i1$1.ConfigService }
36
36
  ]; };
37
37
 
38
- /*
39
- * Copyright 2015-2020 Ritense BV, the Netherlands.
40
- *
41
- * Licensed under EUPL, Version 1.2 (the "License");
42
- * you may not use this file except in compliance with the License.
43
- * You may obtain a copy of the License at
44
- *
45
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
46
- *
47
- * Unless required by applicable law or agreed to in writing, software
48
- * distributed under the License is distributed on an "AS IS" basis,
49
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
50
- * See the License for the specific language governing permissions and
51
- * limitations under the License.
52
- */
53
- var CallbackComponent = /** @class */ (function () {
54
- function CallbackComponent(router, keycloakOptionsService, logger) {
55
- this.router = router;
56
- this.keycloakOptionsService = keycloakOptionsService;
57
- this.logger = logger;
58
- logger.debug('callback');
59
- var savedRedirectTo = window.sessionStorage.getItem('redirectTo');
60
- var redirectTo;
61
- if (savedRedirectTo !== null) {
62
- redirectTo = window.sessionStorage.getItem('redirectTo');
63
- }
64
- else {
65
- redirectTo = '/';
66
- }
67
- logger.debug('keycloak callback redirect =', redirectTo);
68
- this.router.navigate([redirectTo]);
69
- }
70
- return CallbackComponent;
71
- }());
72
- CallbackComponent.decorators = [
73
- { type: i0.Component, args: [{
74
- selector: 'valtimo-keycloak-callback',
75
- template: ''
76
- },] }
77
- ];
78
- CallbackComponent.ctorParameters = function () { return [
79
- { type: i1.Router },
80
- { type: KeycloakOptionsService },
81
- { type: i3.NGXLogger }
38
+ /*
39
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
40
+ *
41
+ * Licensed under EUPL, Version 1.2 (the "License");
42
+ * you may not use this file except in compliance with the License.
43
+ * You may obtain a copy of the License at
44
+ *
45
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
46
+ *
47
+ * Unless required by applicable law or agreed to in writing, software
48
+ * distributed under the License is distributed on an "AS IS" basis,
49
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
50
+ * See the License for the specific language governing permissions and
51
+ * limitations under the License.
52
+ */
53
+ var CallbackComponent = /** @class */ (function () {
54
+ function CallbackComponent(router, keycloakOptionsService, logger) {
55
+ this.router = router;
56
+ this.keycloakOptionsService = keycloakOptionsService;
57
+ this.logger = logger;
58
+ logger.debug('callback');
59
+ var savedRedirectTo = window.sessionStorage.getItem('redirectTo');
60
+ var redirectTo;
61
+ if (savedRedirectTo !== null) {
62
+ redirectTo = window.sessionStorage.getItem('redirectTo');
63
+ }
64
+ else {
65
+ redirectTo = '/';
66
+ }
67
+ logger.debug('keycloak callback redirect =', redirectTo);
68
+ this.router.navigate([redirectTo]);
69
+ }
70
+ return CallbackComponent;
71
+ }());
72
+ CallbackComponent.decorators = [
73
+ { type: i0.Component, args: [{
74
+ selector: 'valtimo-keycloak-callback',
75
+ template: ''
76
+ },] }
77
+ ];
78
+ CallbackComponent.ctorParameters = function () { return [
79
+ { type: i1.Router },
80
+ { type: KeycloakOptionsService },
81
+ { type: i3.NGXLogger }
82
82
  ]; };
83
83
 
84
- /*
85
- * Copyright 2015-2020 Ritense BV, the Netherlands.
86
- *
87
- * Licensed under EUPL, Version 1.2 (the "License");
88
- * you may not use this file except in compliance with the License.
89
- * You may obtain a copy of the License at
90
- *
91
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
92
- *
93
- * Unless required by applicable law or agreed to in writing, software
94
- * distributed under the License is distributed on an "AS IS" basis,
95
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
96
- * See the License for the specific language governing permissions and
97
- * limitations under the License.
98
- */
99
- var ɵ0 = { title: 'Loading...' };
100
- var routes = [
101
- {
102
- path: 'keycloak/callback',
103
- component: CallbackComponent,
104
- data: ɵ0
105
- }
106
- ];
107
- var KeycloakRoutingModule = /** @class */ (function () {
108
- function KeycloakRoutingModule() {
109
- }
110
- return KeycloakRoutingModule;
111
- }());
112
- KeycloakRoutingModule.decorators = [
113
- { type: i0.NgModule, args: [{
114
- imports: [common.CommonModule, i1.RouterModule.forChild(routes)],
115
- exports: [i1.RouterModule]
116
- },] }
84
+ /*
85
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
86
+ *
87
+ * Licensed under EUPL, Version 1.2 (the "License");
88
+ * you may not use this file except in compliance with the License.
89
+ * You may obtain a copy of the License at
90
+ *
91
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
92
+ *
93
+ * Unless required by applicable law or agreed to in writing, software
94
+ * distributed under the License is distributed on an "AS IS" basis,
95
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
96
+ * See the License for the specific language governing permissions and
97
+ * limitations under the License.
98
+ */
99
+ var ɵ0 = { title: 'Loading...' };
100
+ var routes = [
101
+ {
102
+ path: 'keycloak/callback',
103
+ component: CallbackComponent,
104
+ data: ɵ0,
105
+ },
106
+ ];
107
+ var KeycloakRoutingModule = /** @class */ (function () {
108
+ function KeycloakRoutingModule() {
109
+ }
110
+ return KeycloakRoutingModule;
111
+ }());
112
+ KeycloakRoutingModule.decorators = [
113
+ { type: i0.NgModule, args: [{
114
+ imports: [common.CommonModule, i1.RouterModule.forChild(routes)],
115
+ exports: [i1.RouterModule],
116
+ },] }
117
117
  ];
118
118
 
119
- /*
120
- * Copyright 2015-2020 Ritense BV, the Netherlands.
121
- *
122
- * Licensed under EUPL, Version 1.2 (the "License");
123
- * you may not use this file except in compliance with the License.
124
- * You may obtain a copy of the License at
125
- *
126
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
127
- *
128
- * Unless required by applicable law or agreed to in writing, software
129
- * distributed under the License is distributed on an "AS IS" basis,
130
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131
- * See the License for the specific language governing permissions and
132
- * limitations under the License.
133
- */
134
- var KeycloakModule = /** @class */ (function () {
135
- function KeycloakModule() {
136
- }
137
- return KeycloakModule;
138
- }());
139
- KeycloakModule.decorators = [
140
- { type: i0.NgModule, args: [{
141
- declarations: [CallbackComponent],
142
- imports: [
143
- KeycloakRoutingModule,
144
- i2.KeycloakAngularModule
145
- ],
146
- exports: [CallbackComponent]
147
- },] }
119
+ /*
120
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
121
+ *
122
+ * Licensed under EUPL, Version 1.2 (the "License");
123
+ * you may not use this file except in compliance with the License.
124
+ * You may obtain a copy of the License at
125
+ *
126
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
127
+ *
128
+ * Unless required by applicable law or agreed to in writing, software
129
+ * distributed under the License is distributed on an "AS IS" basis,
130
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131
+ * See the License for the specific language governing permissions and
132
+ * limitations under the License.
133
+ */
134
+ var KeycloakModule = /** @class */ (function () {
135
+ function KeycloakModule() {
136
+ }
137
+ return KeycloakModule;
138
+ }());
139
+ KeycloakModule.decorators = [
140
+ { type: i0.NgModule, args: [{
141
+ declarations: [CallbackComponent],
142
+ imports: [KeycloakRoutingModule, i2.KeycloakAngularModule],
143
+ exports: [CallbackComponent],
144
+ },] }
148
145
  ];
149
146
 
150
- /*! *****************************************************************************
151
- Copyright (c) Microsoft Corporation.
152
-
153
- Permission to use, copy, modify, and/or distribute this software for any
154
- purpose with or without fee is hereby granted.
155
-
156
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
157
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
158
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
159
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
160
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
161
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
162
- PERFORMANCE OF THIS SOFTWARE.
163
- ***************************************************************************** */
164
- /* global Reflect, Promise */
165
- var extendStatics = function (d, b) {
166
- extendStatics = Object.setPrototypeOf ||
167
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
168
- function (d, b) { for (var p in b)
169
- if (Object.prototype.hasOwnProperty.call(b, p))
170
- d[p] = b[p]; };
171
- return extendStatics(d, b);
172
- };
173
- function __extends(d, b) {
174
- extendStatics(d, b);
175
- function __() { this.constructor = d; }
176
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
177
- }
178
- var __assign = function () {
179
- __assign = Object.assign || function __assign(t) {
180
- for (var s, i = 1, n = arguments.length; i < n; i++) {
181
- s = arguments[i];
182
- for (var p in s)
183
- if (Object.prototype.hasOwnProperty.call(s, p))
184
- t[p] = s[p];
185
- }
186
- return t;
187
- };
188
- return __assign.apply(this, arguments);
189
- };
190
- function __rest(s, e) {
191
- var t = {};
192
- for (var p in s)
193
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
194
- t[p] = s[p];
195
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
196
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
197
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
198
- t[p[i]] = s[p[i]];
199
- }
200
- return t;
201
- }
202
- function __decorate(decorators, target, key, desc) {
203
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
204
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
205
- r = Reflect.decorate(decorators, target, key, desc);
206
- else
207
- for (var i = decorators.length - 1; i >= 0; i--)
208
- if (d = decorators[i])
209
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
210
- return c > 3 && r && Object.defineProperty(target, key, r), r;
211
- }
212
- function __param(paramIndex, decorator) {
213
- return function (target, key) { decorator(target, key, paramIndex); };
214
- }
215
- function __metadata(metadataKey, metadataValue) {
216
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
217
- return Reflect.metadata(metadataKey, metadataValue);
218
- }
219
- function __awaiter(thisArg, _arguments, P, generator) {
220
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
221
- return new (P || (P = Promise))(function (resolve, reject) {
222
- function fulfilled(value) { try {
223
- step(generator.next(value));
224
- }
225
- catch (e) {
226
- reject(e);
227
- } }
228
- function rejected(value) { try {
229
- step(generator["throw"](value));
230
- }
231
- catch (e) {
232
- reject(e);
233
- } }
234
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
235
- step((generator = generator.apply(thisArg, _arguments || [])).next());
236
- });
237
- }
238
- function __generator(thisArg, body) {
239
- var _ = { label: 0, sent: function () { if (t[0] & 1)
240
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
241
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
242
- function verb(n) { return function (v) { return step([n, v]); }; }
243
- function step(op) {
244
- if (f)
245
- throw new TypeError("Generator is already executing.");
246
- while (_)
247
- try {
248
- 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)
249
- return t;
250
- if (y = 0, t)
251
- op = [op[0] & 2, t.value];
252
- switch (op[0]) {
253
- case 0:
254
- case 1:
255
- t = op;
256
- break;
257
- case 4:
258
- _.label++;
259
- return { value: op[1], done: false };
260
- case 5:
261
- _.label++;
262
- y = op[1];
263
- op = [0];
264
- continue;
265
- case 7:
266
- op = _.ops.pop();
267
- _.trys.pop();
268
- continue;
269
- default:
270
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
271
- _ = 0;
272
- continue;
273
- }
274
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
275
- _.label = op[1];
276
- break;
277
- }
278
- if (op[0] === 6 && _.label < t[1]) {
279
- _.label = t[1];
280
- t = op;
281
- break;
282
- }
283
- if (t && _.label < t[2]) {
284
- _.label = t[2];
285
- _.ops.push(op);
286
- break;
287
- }
288
- if (t[2])
289
- _.ops.pop();
290
- _.trys.pop();
291
- continue;
292
- }
293
- op = body.call(thisArg, _);
294
- }
295
- catch (e) {
296
- op = [6, e];
297
- y = 0;
298
- }
299
- finally {
300
- f = t = 0;
301
- }
302
- if (op[0] & 5)
303
- throw op[1];
304
- return { value: op[0] ? op[1] : void 0, done: true };
305
- }
306
- }
307
- var __createBinding = Object.create ? (function (o, m, k, k2) {
308
- if (k2 === undefined)
309
- k2 = k;
310
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
311
- }) : (function (o, m, k, k2) {
312
- if (k2 === undefined)
313
- k2 = k;
314
- o[k2] = m[k];
315
- });
316
- function __exportStar(m, o) {
317
- for (var p in m)
318
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
319
- __createBinding(o, m, p);
320
- }
321
- function __values(o) {
322
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
323
- if (m)
324
- return m.call(o);
325
- if (o && typeof o.length === "number")
326
- return {
327
- next: function () {
328
- if (o && i >= o.length)
329
- o = void 0;
330
- return { value: o && o[i++], done: !o };
331
- }
332
- };
333
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
334
- }
335
- function __read(o, n) {
336
- var m = typeof Symbol === "function" && o[Symbol.iterator];
337
- if (!m)
338
- return o;
339
- var i = m.call(o), r, ar = [], e;
340
- try {
341
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
342
- ar.push(r.value);
343
- }
344
- catch (error) {
345
- e = { error: error };
346
- }
347
- finally {
348
- try {
349
- if (r && !r.done && (m = i["return"]))
350
- m.call(i);
351
- }
352
- finally {
353
- if (e)
354
- throw e.error;
355
- }
356
- }
357
- return ar;
358
- }
359
- function __spread() {
360
- for (var ar = [], i = 0; i < arguments.length; i++)
361
- ar = ar.concat(__read(arguments[i]));
362
- return ar;
363
- }
364
- function __spreadArrays() {
365
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
366
- s += arguments[i].length;
367
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
368
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
369
- r[k] = a[j];
370
- return r;
371
- }
372
- ;
373
- function __await(v) {
374
- return this instanceof __await ? (this.v = v, this) : new __await(v);
375
- }
376
- function __asyncGenerator(thisArg, _arguments, generator) {
377
- if (!Symbol.asyncIterator)
378
- throw new TypeError("Symbol.asyncIterator is not defined.");
379
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
380
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
381
- function verb(n) { if (g[n])
382
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
383
- function resume(n, v) { try {
384
- step(g[n](v));
385
- }
386
- catch (e) {
387
- settle(q[0][3], e);
388
- } }
389
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
390
- function fulfill(value) { resume("next", value); }
391
- function reject(value) { resume("throw", value); }
392
- function settle(f, v) { if (f(v), q.shift(), q.length)
393
- resume(q[0][0], q[0][1]); }
394
- }
395
- function __asyncDelegator(o) {
396
- var i, p;
397
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
398
- 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; }
399
- }
400
- function __asyncValues(o) {
401
- if (!Symbol.asyncIterator)
402
- throw new TypeError("Symbol.asyncIterator is not defined.");
403
- var m = o[Symbol.asyncIterator], i;
404
- 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);
405
- 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); }); }; }
406
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
407
- }
408
- function __makeTemplateObject(cooked, raw) {
409
- if (Object.defineProperty) {
410
- Object.defineProperty(cooked, "raw", { value: raw });
411
- }
412
- else {
413
- cooked.raw = raw;
414
- }
415
- return cooked;
416
- }
417
- ;
418
- var __setModuleDefault = Object.create ? (function (o, v) {
419
- Object.defineProperty(o, "default", { enumerable: true, value: v });
420
- }) : function (o, v) {
421
- o["default"] = v;
422
- };
423
- function __importStar(mod) {
424
- if (mod && mod.__esModule)
425
- return mod;
426
- var result = {};
427
- if (mod != null)
428
- for (var k in mod)
429
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
430
- __createBinding(result, mod, k);
431
- __setModuleDefault(result, mod);
432
- return result;
433
- }
434
- function __importDefault(mod) {
435
- return (mod && mod.__esModule) ? mod : { default: mod };
436
- }
437
- function __classPrivateFieldGet(receiver, privateMap) {
438
- if (!privateMap.has(receiver)) {
439
- throw new TypeError("attempted to get private field on non-instance");
440
- }
441
- return privateMap.get(receiver);
442
- }
443
- function __classPrivateFieldSet(receiver, privateMap, value) {
444
- if (!privateMap.has(receiver)) {
445
- throw new TypeError("attempted to set private field on non-instance");
446
- }
447
- privateMap.set(receiver, value);
448
- return value;
147
+ /*! *****************************************************************************
148
+ Copyright (c) Microsoft Corporation.
149
+
150
+ Permission to use, copy, modify, and/or distribute this software for any
151
+ purpose with or without fee is hereby granted.
152
+
153
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
154
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
155
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
156
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
157
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
158
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
159
+ PERFORMANCE OF THIS SOFTWARE.
160
+ ***************************************************************************** */
161
+ /* global Reflect, Promise */
162
+ var extendStatics = function (d, b) {
163
+ extendStatics = Object.setPrototypeOf ||
164
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
165
+ function (d, b) { for (var p in b)
166
+ if (Object.prototype.hasOwnProperty.call(b, p))
167
+ d[p] = b[p]; };
168
+ return extendStatics(d, b);
169
+ };
170
+ function __extends(d, b) {
171
+ if (typeof b !== "function" && b !== null)
172
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
173
+ extendStatics(d, b);
174
+ function __() { this.constructor = d; }
175
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
176
+ }
177
+ var __assign = function () {
178
+ __assign = Object.assign || function __assign(t) {
179
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
180
+ s = arguments[i];
181
+ for (var p in s)
182
+ if (Object.prototype.hasOwnProperty.call(s, p))
183
+ t[p] = s[p];
184
+ }
185
+ return t;
186
+ };
187
+ return __assign.apply(this, arguments);
188
+ };
189
+ function __rest(s, e) {
190
+ var t = {};
191
+ for (var p in s)
192
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
193
+ t[p] = s[p];
194
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
195
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
196
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
197
+ t[p[i]] = s[p[i]];
198
+ }
199
+ return t;
200
+ }
201
+ function __decorate(decorators, target, key, desc) {
202
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
203
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
204
+ r = Reflect.decorate(decorators, target, key, desc);
205
+ else
206
+ for (var i = decorators.length - 1; i >= 0; i--)
207
+ if (d = decorators[i])
208
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
209
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
210
+ }
211
+ function __param(paramIndex, decorator) {
212
+ return function (target, key) { decorator(target, key, paramIndex); };
213
+ }
214
+ function __metadata(metadataKey, metadataValue) {
215
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
216
+ return Reflect.metadata(metadataKey, metadataValue);
217
+ }
218
+ function __awaiter(thisArg, _arguments, P, generator) {
219
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
220
+ return new (P || (P = Promise))(function (resolve, reject) {
221
+ function fulfilled(value) { try {
222
+ step(generator.next(value));
223
+ }
224
+ catch (e) {
225
+ reject(e);
226
+ } }
227
+ function rejected(value) { try {
228
+ step(generator["throw"](value));
229
+ }
230
+ catch (e) {
231
+ reject(e);
232
+ } }
233
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
234
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
235
+ });
236
+ }
237
+ function __generator(thisArg, body) {
238
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
239
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
240
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
241
+ function verb(n) { return function (v) { return step([n, v]); }; }
242
+ function step(op) {
243
+ if (f)
244
+ throw new TypeError("Generator is already executing.");
245
+ while (_)
246
+ try {
247
+ 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)
248
+ return t;
249
+ if (y = 0, t)
250
+ op = [op[0] & 2, t.value];
251
+ switch (op[0]) {
252
+ case 0:
253
+ case 1:
254
+ t = op;
255
+ break;
256
+ case 4:
257
+ _.label++;
258
+ return { value: op[1], done: false };
259
+ case 5:
260
+ _.label++;
261
+ y = op[1];
262
+ op = [0];
263
+ continue;
264
+ case 7:
265
+ op = _.ops.pop();
266
+ _.trys.pop();
267
+ continue;
268
+ default:
269
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
270
+ _ = 0;
271
+ continue;
272
+ }
273
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
274
+ _.label = op[1];
275
+ break;
276
+ }
277
+ if (op[0] === 6 && _.label < t[1]) {
278
+ _.label = t[1];
279
+ t = op;
280
+ break;
281
+ }
282
+ if (t && _.label < t[2]) {
283
+ _.label = t[2];
284
+ _.ops.push(op);
285
+ break;
286
+ }
287
+ if (t[2])
288
+ _.ops.pop();
289
+ _.trys.pop();
290
+ continue;
291
+ }
292
+ op = body.call(thisArg, _);
293
+ }
294
+ catch (e) {
295
+ op = [6, e];
296
+ y = 0;
297
+ }
298
+ finally {
299
+ f = t = 0;
300
+ }
301
+ if (op[0] & 5)
302
+ throw op[1];
303
+ return { value: op[0] ? op[1] : void 0, done: true };
304
+ }
305
+ }
306
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
307
+ if (k2 === undefined)
308
+ k2 = k;
309
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
310
+ }) : (function (o, m, k, k2) {
311
+ if (k2 === undefined)
312
+ k2 = k;
313
+ o[k2] = m[k];
314
+ });
315
+ function __exportStar(m, o) {
316
+ for (var p in m)
317
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
318
+ __createBinding(o, m, p);
319
+ }
320
+ function __values(o) {
321
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
322
+ if (m)
323
+ return m.call(o);
324
+ if (o && typeof o.length === "number")
325
+ return {
326
+ next: function () {
327
+ if (o && i >= o.length)
328
+ o = void 0;
329
+ return { value: o && o[i++], done: !o };
330
+ }
331
+ };
332
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
333
+ }
334
+ function __read(o, n) {
335
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
336
+ if (!m)
337
+ return o;
338
+ var i = m.call(o), r, ar = [], e;
339
+ try {
340
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
341
+ ar.push(r.value);
342
+ }
343
+ catch (error) {
344
+ e = { error: error };
345
+ }
346
+ finally {
347
+ try {
348
+ if (r && !r.done && (m = i["return"]))
349
+ m.call(i);
350
+ }
351
+ finally {
352
+ if (e)
353
+ throw e.error;
354
+ }
355
+ }
356
+ return ar;
357
+ }
358
+ /** @deprecated */
359
+ function __spread() {
360
+ for (var ar = [], i = 0; i < arguments.length; i++)
361
+ ar = ar.concat(__read(arguments[i]));
362
+ return ar;
363
+ }
364
+ /** @deprecated */
365
+ function __spreadArrays() {
366
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
367
+ s += arguments[i].length;
368
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
369
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
370
+ r[k] = a[j];
371
+ return r;
372
+ }
373
+ function __spreadArray(to, from, pack) {
374
+ if (pack || arguments.length === 2)
375
+ for (var i = 0, l = from.length, ar; i < l; i++) {
376
+ if (ar || !(i in from)) {
377
+ if (!ar)
378
+ ar = Array.prototype.slice.call(from, 0, i);
379
+ ar[i] = from[i];
380
+ }
381
+ }
382
+ return to.concat(ar || Array.prototype.slice.call(from));
383
+ }
384
+ function __await(v) {
385
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
386
+ }
387
+ function __asyncGenerator(thisArg, _arguments, generator) {
388
+ if (!Symbol.asyncIterator)
389
+ throw new TypeError("Symbol.asyncIterator is not defined.");
390
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
391
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
392
+ function verb(n) { if (g[n])
393
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
394
+ function resume(n, v) { try {
395
+ step(g[n](v));
396
+ }
397
+ catch (e) {
398
+ settle(q[0][3], e);
399
+ } }
400
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
401
+ function fulfill(value) { resume("next", value); }
402
+ function reject(value) { resume("throw", value); }
403
+ function settle(f, v) { if (f(v), q.shift(), q.length)
404
+ resume(q[0][0], q[0][1]); }
405
+ }
406
+ function __asyncDelegator(o) {
407
+ var i, p;
408
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
409
+ 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; }
410
+ }
411
+ function __asyncValues(o) {
412
+ if (!Symbol.asyncIterator)
413
+ throw new TypeError("Symbol.asyncIterator is not defined.");
414
+ var m = o[Symbol.asyncIterator], i;
415
+ 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);
416
+ 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); }); }; }
417
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
418
+ }
419
+ function __makeTemplateObject(cooked, raw) {
420
+ if (Object.defineProperty) {
421
+ Object.defineProperty(cooked, "raw", { value: raw });
422
+ }
423
+ else {
424
+ cooked.raw = raw;
425
+ }
426
+ return cooked;
427
+ }
428
+ ;
429
+ var __setModuleDefault = Object.create ? (function (o, v) {
430
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
431
+ }) : function (o, v) {
432
+ o["default"] = v;
433
+ };
434
+ function __importStar(mod) {
435
+ if (mod && mod.__esModule)
436
+ return mod;
437
+ var result = {};
438
+ if (mod != null)
439
+ for (var k in mod)
440
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
441
+ __createBinding(result, mod, k);
442
+ __setModuleDefault(result, mod);
443
+ return result;
444
+ }
445
+ function __importDefault(mod) {
446
+ return (mod && mod.__esModule) ? mod : { default: mod };
447
+ }
448
+ function __classPrivateFieldGet(receiver, state, kind, f) {
449
+ if (kind === "a" && !f)
450
+ throw new TypeError("Private accessor was defined without a getter");
451
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
452
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
453
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
454
+ }
455
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
456
+ if (kind === "m")
457
+ throw new TypeError("Private method is not writable");
458
+ if (kind === "a" && !f)
459
+ throw new TypeError("Private accessor was defined without a setter");
460
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
461
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
462
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
449
463
  }
450
464
 
451
- var KeycloakAuthGuardService = /** @class */ (function (_super) {
452
- __extends(KeycloakAuthGuardService, _super);
453
- function KeycloakAuthGuardService(router, keycloakAngular, logger) {
454
- var _this = _super.call(this, router, keycloakAngular) || this;
455
- _this.router = router;
456
- _this.keycloakAngular = keycloakAngular;
457
- _this.logger = logger;
458
- _this.logger.debug('KeycloakAuthGuardService: ctor');
459
- return _this;
460
- }
461
- KeycloakAuthGuardService.prototype.isAccessAllowed = function (route, state) {
462
- var _this = this;
463
- this.logger.debug('KeycloakAuthGuardService: isAccessAllowed');
464
- return new Promise(function (resolve, reject) {
465
- _this.logger.debug('KeycloakAuthGuardService: isAccessAllowed checking access');
466
- if (!_this.authenticated) {
467
- _this.keycloakAngular.login().catch(function (e) { return "KeycloakAuthGuardService error: " + _this.logger.error(e); });
468
- return reject(false);
469
- }
470
- var requiredRoles = route.data.roles;
471
- if (!requiredRoles || requiredRoles.length === 0) {
472
- return resolve(true);
473
- }
474
- else {
475
- if (!_this.roles || _this.roles.length === 0) {
476
- resolve(false);
477
- }
478
- resolve(requiredRoles.some(function (role) { return _this.roles.includes(role); }));
479
- }
480
- });
481
- };
482
- return KeycloakAuthGuardService;
483
- }(i2.KeycloakAuthGuard));
484
- KeycloakAuthGuardService.ɵprov = i0.ɵɵdefineInjectable({ factory: function KeycloakAuthGuardService_Factory() { return new KeycloakAuthGuardService(i0.ɵɵinject(i1.Router), i0.ɵɵinject(i2.KeycloakService), i0.ɵɵinject(i3.NGXLogger)); }, token: KeycloakAuthGuardService, providedIn: "root" });
485
- KeycloakAuthGuardService.decorators = [
486
- { type: i0.Injectable, args: [{
487
- providedIn: 'root'
488
- },] }
489
- ];
490
- KeycloakAuthGuardService.ctorParameters = function () { return [
491
- { type: i1.Router },
492
- { type: i2.KeycloakService },
493
- { type: i3.NGXLogger }
465
+ var KeycloakAuthGuardService = /** @class */ (function (_super) {
466
+ __extends(KeycloakAuthGuardService, _super);
467
+ function KeycloakAuthGuardService(router, keycloakAngular, logger) {
468
+ var _this = _super.call(this, router, keycloakAngular) || this;
469
+ _this.router = router;
470
+ _this.keycloakAngular = keycloakAngular;
471
+ _this.logger = logger;
472
+ _this.logger.debug('KeycloakAuthGuardService: ctor');
473
+ return _this;
474
+ }
475
+ KeycloakAuthGuardService.prototype.isAccessAllowed = function (route, state) {
476
+ var _this = this;
477
+ this.logger.debug('KeycloakAuthGuardService: isAccessAllowed');
478
+ return new Promise(function (resolve, reject) {
479
+ _this.logger.debug('KeycloakAuthGuardService: isAccessAllowed checking access');
480
+ if (!_this.authenticated) {
481
+ _this.keycloakAngular
482
+ .login()
483
+ .catch(function (e) { return "KeycloakAuthGuardService error: " + _this.logger.error(e); });
484
+ return reject(false);
485
+ }
486
+ var requiredRoles = route.data.roles;
487
+ if (!requiredRoles || requiredRoles.length === 0) {
488
+ return resolve(true);
489
+ }
490
+ else {
491
+ if (!_this.roles || _this.roles.length === 0) {
492
+ resolve(false);
493
+ }
494
+ resolve(requiredRoles.some(function (role) { return _this.roles.includes(role); }));
495
+ }
496
+ });
497
+ };
498
+ return KeycloakAuthGuardService;
499
+ }(i2.KeycloakAuthGuard));
500
+ KeycloakAuthGuardService.ɵprov = i0.ɵɵdefineInjectable({ factory: function KeycloakAuthGuardService_Factory() { return new KeycloakAuthGuardService(i0.ɵɵinject(i1.Router), i0.ɵɵinject(i2.KeycloakService), i0.ɵɵinject(i3.NGXLogger)); }, token: KeycloakAuthGuardService, providedIn: "root" });
501
+ KeycloakAuthGuardService.decorators = [
502
+ { type: i0.Injectable, args: [{
503
+ providedIn: 'root',
504
+ },] }
505
+ ];
506
+ KeycloakAuthGuardService.ctorParameters = function () { return [
507
+ { type: i1.Router },
508
+ { type: i2.KeycloakService },
509
+ { type: i3.NGXLogger }
494
510
  ]; };
495
511
 
496
- var KeycloakUserService = /** @class */ (function () {
497
- function KeycloakUserService(keycloakService, keycloakOptionsService, logger) {
498
- this.keycloakService = keycloakService;
499
- this.keycloakOptionsService = keycloakOptionsService;
500
- this.logger = logger;
501
- }
502
- KeycloakUserService.prototype.init = function () {
503
- var _this = this;
504
- this.userIdentity = new rxjs.ReplaySubject();
505
- this.keycloakService.loadUserProfile().then(function (user) {
506
- _this.logger.debug('KeycloakUserService: loadUserProfile = ', user);
507
- var roles = [];
508
- _this.keycloakService.getUserRoles(true).forEach(function (role) { return roles.push(role); });
509
- var valtimoUserIdentity = new contract.ValtimoUserIdentity(user.email, user.firstName, user.lastName, roles, user.username);
510
- _this.logger.debug('KeycloakUserService: loaded user identity', valtimoUserIdentity);
511
- _this.userIdentity.next(valtimoUserIdentity);
512
- });
513
- };
514
- KeycloakUserService.prototype.getUserSubject = function () {
515
- this.logger.debug('KeycloakUserService: getUserIdentity');
516
- return this.userIdentity;
517
- };
518
- KeycloakUserService.prototype.logout = function () {
519
- this.logger.debug('KeycloakUserService: logout');
520
- this.keycloakService.logout(this.keycloakOptionsService.logoutRedirectUri);
521
- };
522
- KeycloakUserService.prototype.getToken = function () {
523
- return __awaiter(this, void 0, void 0, function () {
524
- return __generator(this, function (_a) {
525
- this.logger.debug('KeycloakUserService: getToken');
526
- return [2 /*return*/, this.keycloakService.getToken()];
527
- });
528
- });
529
- };
530
- KeycloakUserService.prototype.updateToken = function (minValidity) {
531
- return __awaiter(this, void 0, void 0, function () {
532
- return __generator(this, function (_a) {
533
- this.logger.debug('KeycloakUserService: updateToken');
534
- return [2 /*return*/, this.keycloakService.updateToken(minValidity)];
535
- });
536
- });
537
- };
538
- return KeycloakUserService;
539
- }());
540
- KeycloakUserService.ɵprov = i0.ɵɵdefineInjectable({ factory: function KeycloakUserService_Factory() { return new KeycloakUserService(i0.ɵɵinject(i2.KeycloakService), i0.ɵɵinject(KeycloakOptionsService), i0.ɵɵinject(i3.NGXLogger)); }, token: KeycloakUserService, providedIn: "root" });
541
- KeycloakUserService.decorators = [
542
- { type: i0.Injectable, args: [{
543
- providedIn: 'root'
544
- },] }
545
- ];
546
- KeycloakUserService.ctorParameters = function () { return [
547
- { type: i2.KeycloakService },
548
- { type: KeycloakOptionsService },
549
- { type: i3.NGXLogger }
512
+ var KeycloakUserService = /** @class */ (function () {
513
+ function KeycloakUserService(keycloakService, keycloakOptionsService, logger) {
514
+ this.keycloakService = keycloakService;
515
+ this.keycloakOptionsService = keycloakOptionsService;
516
+ this.logger = logger;
517
+ }
518
+ KeycloakUserService.prototype.init = function () {
519
+ var _this = this;
520
+ this.userIdentity = new rxjs.ReplaySubject();
521
+ this.keycloakService.loadUserProfile().then(function (user) {
522
+ _this.logger.debug('KeycloakUserService: loadUserProfile = ', user);
523
+ var roles = [];
524
+ _this.keycloakService.getUserRoles(true).forEach(function (role) { return roles.push(role); });
525
+ var valtimoUserIdentity = new contract.ValtimoUserIdentity(user.email, user.firstName, user.lastName, roles, user.username);
526
+ _this.logger.debug('KeycloakUserService: loaded user identity', valtimoUserIdentity);
527
+ _this.userIdentity.next(valtimoUserIdentity);
528
+ });
529
+ };
530
+ KeycloakUserService.prototype.getUserSubject = function () {
531
+ this.logger.debug('KeycloakUserService: getUserIdentity');
532
+ return this.userIdentity;
533
+ };
534
+ KeycloakUserService.prototype.logout = function () {
535
+ this.logger.debug('KeycloakUserService: logout');
536
+ this.keycloakService.logout(this.keycloakOptionsService.logoutRedirectUri);
537
+ };
538
+ KeycloakUserService.prototype.getToken = function () {
539
+ return __awaiter(this, void 0, void 0, function () {
540
+ return __generator(this, function (_a) {
541
+ this.logger.debug('KeycloakUserService: getToken');
542
+ return [2 /*return*/, this.keycloakService.getToken()];
543
+ });
544
+ });
545
+ };
546
+ KeycloakUserService.prototype.updateToken = function (minValidity) {
547
+ return __awaiter(this, void 0, void 0, function () {
548
+ return __generator(this, function (_a) {
549
+ this.logger.debug('KeycloakUserService: updateToken');
550
+ return [2 /*return*/, this.keycloakService.updateToken(minValidity)];
551
+ });
552
+ });
553
+ };
554
+ return KeycloakUserService;
555
+ }());
556
+ KeycloakUserService.ɵprov = i0.ɵɵdefineInjectable({ factory: function KeycloakUserService_Factory() { return new KeycloakUserService(i0.ɵɵinject(i2.KeycloakService), i0.ɵɵinject(KeycloakOptionsService), i0.ɵɵinject(i3.NGXLogger)); }, token: KeycloakUserService, providedIn: "root" });
557
+ KeycloakUserService.decorators = [
558
+ { type: i0.Injectable, args: [{
559
+ providedIn: 'root',
560
+ },] }
561
+ ];
562
+ KeycloakUserService.ctorParameters = function () { return [
563
+ { type: i2.KeycloakService },
564
+ { type: KeycloakOptionsService },
565
+ { type: i3.NGXLogger }
550
566
  ]; };
551
567
 
552
- function keycloakInitializer(injector) {
553
- var _this = this;
554
- var keycloakService = injector.get(i2.KeycloakService);
555
- var keycloakUserService = injector.get(KeycloakUserService);
556
- var optionsService = injector.get(KeycloakOptionsService); // TODO possible removal of abstraction
557
- var logger = injector.get(i3.NGXLogger);
558
- return function () { return __awaiter(_this, void 0, void 0, function () {
559
- var keycloakOptions, currentUrl, redirectTo, initResult, error_1;
560
- return __generator(this, function (_a) {
561
- switch (_a.label) {
562
- case 0:
563
- _a.trys.push([0, 2, , 3]);
564
- logger.debug('Keycloak initializer before init');
565
- keycloakOptions = optionsService.keycloakOptions;
566
- currentUrl = window.location.href.split('#')[0];
567
- if (keycloakOptions.initOptions.redirectUri !== currentUrl) {
568
- redirectTo = window.location.pathname;
569
- logger.debug('Setting redirectTo =', redirectTo);
570
- window.sessionStorage.setItem('redirectTo', redirectTo);
571
- }
572
- return [4 /*yield*/, keycloakService.init(keycloakOptions)];
573
- case 1:
574
- initResult = _a.sent();
575
- logger.debug('Keycloak initializer after init');
576
- keycloakUserService.init();
577
- return [2 /*return*/, initResult];
578
- case 2:
579
- error_1 = _a.sent();
580
- logger.debug('Keycloak initializer error', error_1);
581
- throw error_1;
582
- case 3: return [2 /*return*/];
583
- }
584
- });
585
- }); };
568
+ function keycloakInitializer(injector) {
569
+ var _this = this;
570
+ var keycloakService = injector.get(i2.KeycloakService);
571
+ var keycloakUserService = injector.get(KeycloakUserService);
572
+ var optionsService = injector.get(KeycloakOptionsService); // TODO possible removal of abstraction
573
+ var logger = injector.get(i3.NGXLogger);
574
+ return function () { return __awaiter(_this, void 0, void 0, function () {
575
+ var keycloakOptions, currentUrl, redirectTo, initResult, error_1;
576
+ return __generator(this, function (_a) {
577
+ switch (_a.label) {
578
+ case 0:
579
+ _a.trys.push([0, 2, , 3]);
580
+ logger.debug('Keycloak initializer before init');
581
+ keycloakOptions = optionsService.keycloakOptions;
582
+ currentUrl = window.location.href.split('#')[0];
583
+ if (keycloakOptions.initOptions.redirectUri !== currentUrl) {
584
+ redirectTo = window.location.pathname;
585
+ logger.debug('Setting redirectTo =', redirectTo);
586
+ window.sessionStorage.setItem('redirectTo', redirectTo);
587
+ }
588
+ return [4 /*yield*/, keycloakService.init(keycloakOptions)];
589
+ case 1:
590
+ initResult = _a.sent();
591
+ logger.debug('Keycloak initializer after init');
592
+ keycloakUserService.init();
593
+ return [2 /*return*/, initResult];
594
+ case 2:
595
+ error_1 = _a.sent();
596
+ logger.debug('Keycloak initializer error', error_1);
597
+ throw error_1;
598
+ case 3: return [2 /*return*/];
599
+ }
600
+ });
601
+ }); };
586
602
  }
587
603
 
588
- /*
589
- * Copyright 2015-2020 Ritense BV, the Netherlands.
590
- *
591
- * Licensed under EUPL, Version 1.2 (the "License");
592
- * you may not use this file except in compliance with the License.
593
- * You may obtain a copy of the License at
594
- *
595
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
596
- *
597
- * Unless required by applicable law or agreed to in writing, software
598
- * distributed under the License is distributed on an "AS IS" basis,
599
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
600
- * See the License for the specific language governing permissions and
601
- * limitations under the License.
604
+ /*
605
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
606
+ *
607
+ * Licensed under EUPL, Version 1.2 (the "License");
608
+ * you may not use this file except in compliance with the License.
609
+ * You may obtain a copy of the License at
610
+ *
611
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
612
+ *
613
+ * Unless required by applicable law or agreed to in writing, software
614
+ * distributed under the License is distributed on an "AS IS" basis,
615
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
616
+ * See the License for the specific language governing permissions and
617
+ * limitations under the License.
602
618
  */
603
619
 
604
- /**
605
- * Generated bundle index. Do not edit.
620
+ /**
621
+ * Generated bundle index. Do not edit.
606
622
  */
607
623
 
608
624
  exports.KeycloakAuthGuardService = KeycloakAuthGuardService;