@rxap/oauth 12.1.0 → 13.0.0-next.2

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.
Files changed (107) hide show
  1. package/_theming.scss +1 -1
  2. package/esm2020/index.mjs +17 -0
  3. package/esm2020/lib/container/container.component.mjs +38 -0
  4. package/esm2020/lib/container/container.component.module.mjs +22 -0
  5. package/esm2020/lib/get-o-auth-profile.method.mjs +40 -0
  6. package/esm2020/lib/loading/loading.component.mjs +12 -0
  7. package/esm2020/lib/loading/loading.component.module.mjs +26 -0
  8. package/esm2020/lib/o-auth-extract.guard.mjs +55 -0
  9. package/esm2020/lib/o-auth-redirect.guard.mjs +31 -0
  10. package/esm2020/lib/o-auth-routing.module.mjs +25 -0
  11. package/esm2020/lib/o-auth.method.mjs +111 -0
  12. package/esm2020/lib/o-auth.module.mjs +27 -0
  13. package/esm2020/lib/o-auth.service.mjs +303 -0
  14. package/esm2020/lib/profile.resolve.mjs +37 -0
  15. package/esm2020/lib/routes.mjs +26 -0
  16. package/esm2020/lib/sign-in-with-redirect/sign-in-with-redirect.component.mjs +47 -0
  17. package/esm2020/lib/sign-in-with-redirect/sign-in-with-redirect.component.module.mjs +38 -0
  18. package/esm2020/lib/tokens.mjs +17 -0
  19. package/esm2020/rxap-oauth.mjs +5 -0
  20. package/esm2020/single-sign-on/lib/continue/continue.component.mjs +70 -0
  21. package/esm2020/single-sign-on/lib/continue/continue.component.module.mjs +42 -0
  22. package/esm2020/single-sign-on/lib/error/error.component.mjs +44 -0
  23. package/esm2020/single-sign-on/lib/error/error.component.module.mjs +30 -0
  24. package/esm2020/single-sign-on/lib/o-auth-single-sign-on-routing.module.mjs +50 -0
  25. package/esm2020/single-sign-on/lib/o-auth-single-sign-on.guard.mjs +69 -0
  26. package/esm2020/single-sign-on/lib/o-auth-single-sign-on.service.mjs +77 -0
  27. package/esm2020/single-sign-on/lib/routes.mjs +33 -0
  28. package/esm2020/single-sign-on/lib/tokens.mjs +10 -0
  29. package/esm2020/single-sign-on/public_api.mjs +10 -0
  30. package/esm2020/single-sign-on/rxap-oauth-single-sign-on.mjs +5 -0
  31. package/fesm2015/rxap-oauth-single-sign-on.mjs +408 -0
  32. package/fesm2015/rxap-oauth-single-sign-on.mjs.map +1 -0
  33. package/fesm2015/{rxap-oauth.js → rxap-oauth.mjs} +137 -171
  34. package/fesm2015/rxap-oauth.mjs.map +1 -0
  35. package/fesm2020/rxap-oauth-single-sign-on.mjs +392 -0
  36. package/fesm2020/rxap-oauth-single-sign-on.mjs.map +1 -0
  37. package/fesm2020/rxap-oauth.mjs +801 -0
  38. package/fesm2020/rxap-oauth.mjs.map +1 -0
  39. package/lib/o-auth.method.d.ts +0 -2
  40. package/lib/o-auth.service.d.ts +2 -7
  41. package/package.json +43 -31
  42. package/single-sign-on/package.json +5 -5
  43. package/bundles/rxap-oauth-single-sign-on.umd.js +0 -811
  44. package/bundles/rxap-oauth-single-sign-on.umd.js.map +0 -1
  45. package/bundles/rxap-oauth.umd.js +0 -1373
  46. package/bundles/rxap-oauth.umd.js.map +0 -1
  47. package/esm2015/index.js +0 -17
  48. package/esm2015/index.js.map +0 -1
  49. package/esm2015/lib/container/container.component.js +0 -45
  50. package/esm2015/lib/container/container.component.js.map +0 -1
  51. package/esm2015/lib/container/container.component.module.js +0 -22
  52. package/esm2015/lib/container/container.component.module.js.map +0 -1
  53. package/esm2015/lib/get-o-auth-profile.method.js +0 -41
  54. package/esm2015/lib/get-o-auth-profile.method.js.map +0 -1
  55. package/esm2015/lib/loading/loading.component.js +0 -18
  56. package/esm2015/lib/loading/loading.component.js.map +0 -1
  57. package/esm2015/lib/loading/loading.component.module.js +0 -26
  58. package/esm2015/lib/loading/loading.component.module.js.map +0 -1
  59. package/esm2015/lib/o-auth-extract.guard.js +0 -55
  60. package/esm2015/lib/o-auth-extract.guard.js.map +0 -1
  61. package/esm2015/lib/o-auth-redirect.guard.js +0 -34
  62. package/esm2015/lib/o-auth-redirect.guard.js.map +0 -1
  63. package/esm2015/lib/o-auth-routing.module.js +0 -25
  64. package/esm2015/lib/o-auth-routing.module.js.map +0 -1
  65. package/esm2015/lib/o-auth.method.js +0 -120
  66. package/esm2015/lib/o-auth.method.js.map +0 -1
  67. package/esm2015/lib/o-auth.module.js +0 -28
  68. package/esm2015/lib/o-auth.module.js.map +0 -1
  69. package/esm2015/lib/o-auth.service.js +0 -336
  70. package/esm2015/lib/o-auth.service.js.map +0 -1
  71. package/esm2015/lib/profile.resolve.js +0 -40
  72. package/esm2015/lib/profile.resolve.js.map +0 -1
  73. package/esm2015/lib/routes.js +0 -26
  74. package/esm2015/lib/routes.js.map +0 -1
  75. package/esm2015/lib/sign-in-with-redirect/sign-in-with-redirect.component.js +0 -54
  76. package/esm2015/lib/sign-in-with-redirect/sign-in-with-redirect.component.js.map +0 -1
  77. package/esm2015/lib/sign-in-with-redirect/sign-in-with-redirect.component.module.js +0 -38
  78. package/esm2015/lib/sign-in-with-redirect/sign-in-with-redirect.component.module.js.map +0 -1
  79. package/esm2015/lib/tokens.js +0 -17
  80. package/esm2015/lib/tokens.js.map +0 -1
  81. package/esm2015/rxap-oauth.js +0 -5
  82. package/esm2015/rxap-oauth.js.map +0 -1
  83. package/esm2015/single-sign-on/lib/continue/continue.component.js +0 -77
  84. package/esm2015/single-sign-on/lib/continue/continue.component.js.map +0 -1
  85. package/esm2015/single-sign-on/lib/continue/continue.component.module.js +0 -42
  86. package/esm2015/single-sign-on/lib/continue/continue.component.module.js.map +0 -1
  87. package/esm2015/single-sign-on/lib/error/error.component.js +0 -51
  88. package/esm2015/single-sign-on/lib/error/error.component.js.map +0 -1
  89. package/esm2015/single-sign-on/lib/error/error.component.module.js +0 -30
  90. package/esm2015/single-sign-on/lib/error/error.component.module.js.map +0 -1
  91. package/esm2015/single-sign-on/lib/o-auth-single-sign-on-routing.module.js +0 -50
  92. package/esm2015/single-sign-on/lib/o-auth-single-sign-on-routing.module.js.map +0 -1
  93. package/esm2015/single-sign-on/lib/o-auth-single-sign-on.guard.js +0 -72
  94. package/esm2015/single-sign-on/lib/o-auth-single-sign-on.guard.js.map +0 -1
  95. package/esm2015/single-sign-on/lib/o-auth-single-sign-on.service.js +0 -85
  96. package/esm2015/single-sign-on/lib/o-auth-single-sign-on.service.js.map +0 -1
  97. package/esm2015/single-sign-on/lib/routes.js +0 -33
  98. package/esm2015/single-sign-on/lib/routes.js.map +0 -1
  99. package/esm2015/single-sign-on/lib/tokens.js +0 -10
  100. package/esm2015/single-sign-on/lib/tokens.js.map +0 -1
  101. package/esm2015/single-sign-on/public_api.js +0 -10
  102. package/esm2015/single-sign-on/public_api.js.map +0 -1
  103. package/esm2015/single-sign-on/rxap-oauth-single-sign-on.js +0 -5
  104. package/esm2015/single-sign-on/rxap-oauth-single-sign-on.js.map +0 -1
  105. package/fesm2015/rxap-oauth-single-sign-on.js +0 -416
  106. package/fesm2015/rxap-oauth-single-sign-on.js.map +0 -1
  107. package/fesm2015/rxap-oauth.js.map +0 -1
@@ -1,1373 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('@angular/router'), require('rxjs'), require('@rxap/authentication'), require('@angular/animations'), require('@angular/material/progress-bar'), require('@angular/material/icon'), require('@angular/material/button'), require('@angular/flex-layout/flex'), require('@angular/common'), require('@angular/material/card'), require('@angular/flex-layout')) :
3
- typeof define === 'function' && define.amd ? define('@rxap/oauth', ['exports', '@angular/core', '@angular/common/http', '@angular/router', 'rxjs', '@rxap/authentication', '@angular/animations', '@angular/material/progress-bar', '@angular/material/icon', '@angular/material/button', '@angular/flex-layout/flex', '@angular/common', '@angular/material/card', '@angular/flex-layout'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.rxap = global.rxap || {}, global.rxap.oauth = {}), global.ng.core, global.ng.common.http, global.ng.router, global.rxjs, global.authentication, global.ng.animations, global.ng.material.progressBar, global.ng.material.icon, global.ng.material.button, global.ng.flexLayout.flex, global.ng.common, global.ng.material.card, global.ng.flexLayout));
5
- })(this, (function (exports, i0, i1, i1$1, rxjs, authentication, animations, i1$2, i2, i3, i4, common, card, flexLayout) { 'use strict';
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
18
- }
19
- });
20
- }
21
- n["default"] = e;
22
- return Object.freeze(n);
23
- }
24
-
25
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
27
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
28
- var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
29
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
30
- var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
31
- var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
32
-
33
- var PROFILE_AUTH_ENDPOINT = new i0.InjectionToken('PROFILE_AUTH_ENDPOINT');
34
- var GetOAuthProfileMethod = /** @class */ (function () {
35
- function GetOAuthProfileMethod(http, profileEndpoint) {
36
- if (profileEndpoint === void 0) { profileEndpoint = null; }
37
- this.http = http;
38
- this.profileEndpoint = profileEndpoint;
39
- }
40
- GetOAuthProfileMethod.prototype.call = function (parameters) {
41
- var _a, _b;
42
- var profileEndpoint = (_a = parameters.profileEndpoint) !== null && _a !== void 0 ? _a : this.profileEndpoint;
43
- if (!profileEndpoint) {
44
- throw new Error('The profile endpoint is not defined');
45
- }
46
- return this.http
47
- .get(profileEndpoint, {
48
- headers: {
49
- Authorization: "Bearer " + parameters.accessToken,
50
- },
51
- withCredentials: (_b = parameters.withCredentials) !== null && _b !== void 0 ? _b : true,
52
- })
53
- .toPromise();
54
- };
55
- return GetOAuthProfileMethod;
56
- }());
57
- GetOAuthProfileMethod.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: GetOAuthProfileMethod, deps: [{ token: i1.HttpClient }, { token: PROFILE_AUTH_ENDPOINT, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
58
- GetOAuthProfileMethod.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: GetOAuthProfileMethod, providedIn: 'root' });
59
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: GetOAuthProfileMethod, decorators: [{
60
- type: i0.Injectable,
61
- args: [{ providedIn: 'root' }]
62
- }], ctorParameters: function () {
63
- return [{ type: i1__namespace.HttpClient, decorators: [{
64
- type: i0.Inject,
65
- args: [i1.HttpClient]
66
- }] }, { type: undefined, decorators: [{
67
- type: i0.Optional
68
- }, {
69
- type: i0.Inject,
70
- args: [PROFILE_AUTH_ENDPOINT]
71
- }] }];
72
- } });
73
-
74
- /*! *****************************************************************************
75
- Copyright (c) Microsoft Corporation.
76
-
77
- Permission to use, copy, modify, and/or distribute this software for any
78
- purpose with or without fee is hereby granted.
79
-
80
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
81
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
82
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
83
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
84
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
85
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
86
- PERFORMANCE OF THIS SOFTWARE.
87
- ***************************************************************************** */
88
- /* global Reflect, Promise */
89
- var extendStatics = function (d, b) {
90
- extendStatics = Object.setPrototypeOf ||
91
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
92
- function (d, b) { for (var p in b)
93
- if (Object.prototype.hasOwnProperty.call(b, p))
94
- d[p] = b[p]; };
95
- return extendStatics(d, b);
96
- };
97
- function __extends(d, b) {
98
- if (typeof b !== "function" && b !== null)
99
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
100
- extendStatics(d, b);
101
- function __() { this.constructor = d; }
102
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
103
- }
104
- var __assign = function () {
105
- __assign = Object.assign || function __assign(t) {
106
- for (var s, i = 1, n = arguments.length; i < n; i++) {
107
- s = arguments[i];
108
- for (var p in s)
109
- if (Object.prototype.hasOwnProperty.call(s, p))
110
- t[p] = s[p];
111
- }
112
- return t;
113
- };
114
- return __assign.apply(this, arguments);
115
- };
116
- function __rest(s, e) {
117
- var t = {};
118
- for (var p in s)
119
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
120
- t[p] = s[p];
121
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
122
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
123
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
124
- t[p[i]] = s[p[i]];
125
- }
126
- return t;
127
- }
128
- function __decorate(decorators, target, key, desc) {
129
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
130
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
131
- r = Reflect.decorate(decorators, target, key, desc);
132
- else
133
- for (var i = decorators.length - 1; i >= 0; i--)
134
- if (d = decorators[i])
135
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
136
- return c > 3 && r && Object.defineProperty(target, key, r), r;
137
- }
138
- function __param(paramIndex, decorator) {
139
- return function (target, key) { decorator(target, key, paramIndex); };
140
- }
141
- function __metadata(metadataKey, metadataValue) {
142
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
143
- return Reflect.metadata(metadataKey, metadataValue);
144
- }
145
- function __awaiter(thisArg, _arguments, P, generator) {
146
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
147
- return new (P || (P = Promise))(function (resolve, reject) {
148
- function fulfilled(value) { try {
149
- step(generator.next(value));
150
- }
151
- catch (e) {
152
- reject(e);
153
- } }
154
- function rejected(value) { try {
155
- step(generator["throw"](value));
156
- }
157
- catch (e) {
158
- reject(e);
159
- } }
160
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
161
- step((generator = generator.apply(thisArg, _arguments || [])).next());
162
- });
163
- }
164
- function __generator(thisArg, body) {
165
- var _ = { label: 0, sent: function () { if (t[0] & 1)
166
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
167
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
168
- function verb(n) { return function (v) { return step([n, v]); }; }
169
- function step(op) {
170
- if (f)
171
- throw new TypeError("Generator is already executing.");
172
- while (_)
173
- try {
174
- 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)
175
- return t;
176
- if (y = 0, t)
177
- op = [op[0] & 2, t.value];
178
- switch (op[0]) {
179
- case 0:
180
- case 1:
181
- t = op;
182
- break;
183
- case 4:
184
- _.label++;
185
- return { value: op[1], done: false };
186
- case 5:
187
- _.label++;
188
- y = op[1];
189
- op = [0];
190
- continue;
191
- case 7:
192
- op = _.ops.pop();
193
- _.trys.pop();
194
- continue;
195
- default:
196
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
197
- _ = 0;
198
- continue;
199
- }
200
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
201
- _.label = op[1];
202
- break;
203
- }
204
- if (op[0] === 6 && _.label < t[1]) {
205
- _.label = t[1];
206
- t = op;
207
- break;
208
- }
209
- if (t && _.label < t[2]) {
210
- _.label = t[2];
211
- _.ops.push(op);
212
- break;
213
- }
214
- if (t[2])
215
- _.ops.pop();
216
- _.trys.pop();
217
- continue;
218
- }
219
- op = body.call(thisArg, _);
220
- }
221
- catch (e) {
222
- op = [6, e];
223
- y = 0;
224
- }
225
- finally {
226
- f = t = 0;
227
- }
228
- if (op[0] & 5)
229
- throw op[1];
230
- return { value: op[0] ? op[1] : void 0, done: true };
231
- }
232
- }
233
- var __createBinding = Object.create ? (function (o, m, k, k2) {
234
- if (k2 === undefined)
235
- k2 = k;
236
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
237
- }) : (function (o, m, k, k2) {
238
- if (k2 === undefined)
239
- k2 = k;
240
- o[k2] = m[k];
241
- });
242
- function __exportStar(m, o) {
243
- for (var p in m)
244
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
245
- __createBinding(o, m, p);
246
- }
247
- function __values(o) {
248
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
249
- if (m)
250
- return m.call(o);
251
- if (o && typeof o.length === "number")
252
- return {
253
- next: function () {
254
- if (o && i >= o.length)
255
- o = void 0;
256
- return { value: o && o[i++], done: !o };
257
- }
258
- };
259
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
260
- }
261
- function __read(o, n) {
262
- var m = typeof Symbol === "function" && o[Symbol.iterator];
263
- if (!m)
264
- return o;
265
- var i = m.call(o), r, ar = [], e;
266
- try {
267
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
268
- ar.push(r.value);
269
- }
270
- catch (error) {
271
- e = { error: error };
272
- }
273
- finally {
274
- try {
275
- if (r && !r.done && (m = i["return"]))
276
- m.call(i);
277
- }
278
- finally {
279
- if (e)
280
- throw e.error;
281
- }
282
- }
283
- return ar;
284
- }
285
- /** @deprecated */
286
- function __spread() {
287
- for (var ar = [], i = 0; i < arguments.length; i++)
288
- ar = ar.concat(__read(arguments[i]));
289
- return ar;
290
- }
291
- /** @deprecated */
292
- function __spreadArrays() {
293
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
294
- s += arguments[i].length;
295
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
296
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
297
- r[k] = a[j];
298
- return r;
299
- }
300
- function __spreadArray(to, from) {
301
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
302
- to[j] = from[i];
303
- return to;
304
- }
305
- function __await(v) {
306
- return this instanceof __await ? (this.v = v, this) : new __await(v);
307
- }
308
- function __asyncGenerator(thisArg, _arguments, generator) {
309
- if (!Symbol.asyncIterator)
310
- throw new TypeError("Symbol.asyncIterator is not defined.");
311
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
312
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
313
- function verb(n) { if (g[n])
314
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
315
- function resume(n, v) { try {
316
- step(g[n](v));
317
- }
318
- catch (e) {
319
- settle(q[0][3], e);
320
- } }
321
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
322
- function fulfill(value) { resume("next", value); }
323
- function reject(value) { resume("throw", value); }
324
- function settle(f, v) { if (f(v), q.shift(), q.length)
325
- resume(q[0][0], q[0][1]); }
326
- }
327
- function __asyncDelegator(o) {
328
- var i, p;
329
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
330
- 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; }
331
- }
332
- function __asyncValues(o) {
333
- if (!Symbol.asyncIterator)
334
- throw new TypeError("Symbol.asyncIterator is not defined.");
335
- var m = o[Symbol.asyncIterator], i;
336
- 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);
337
- 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); }); }; }
338
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
339
- }
340
- function __makeTemplateObject(cooked, raw) {
341
- if (Object.defineProperty) {
342
- Object.defineProperty(cooked, "raw", { value: raw });
343
- }
344
- else {
345
- cooked.raw = raw;
346
- }
347
- return cooked;
348
- }
349
- ;
350
- var __setModuleDefault = Object.create ? (function (o, v) {
351
- Object.defineProperty(o, "default", { enumerable: true, value: v });
352
- }) : function (o, v) {
353
- o["default"] = v;
354
- };
355
- function __importStar(mod) {
356
- if (mod && mod.__esModule)
357
- return mod;
358
- var result = {};
359
- if (mod != null)
360
- for (var k in mod)
361
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
362
- __createBinding(result, mod, k);
363
- __setModuleDefault(result, mod);
364
- return result;
365
- }
366
- function __importDefault(mod) {
367
- return (mod && mod.__esModule) ? mod : { default: mod };
368
- }
369
- function __classPrivateFieldGet(receiver, state, kind, f) {
370
- if (kind === "a" && !f)
371
- throw new TypeError("Private accessor was defined without a getter");
372
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
373
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
374
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
375
- }
376
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
377
- if (kind === "m")
378
- throw new TypeError("Private method is not writable");
379
- if (kind === "a" && !f)
380
- throw new TypeError("Private accessor was defined without a setter");
381
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
382
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
383
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
384
- }
385
-
386
- function IsOAuthMethodWithRefreshTokenParameters(parameters) {
387
- // eslint-disable-next-line no-prototype-builtins
388
- return parameters.hasOwnProperty('refreshToken');
389
- }
390
- function IsOAuthMethodWithUsernamePasswordParameters(parameters) {
391
- // eslint-disable-next-line no-prototype-builtins
392
- return (parameters.hasOwnProperty('username') &&
393
- parameters.hasOwnProperty('password'));
394
- }
395
- function AssertOAuthMethodWithUsernamePasswordParameters(parameters) {
396
- if (!IsOAuthMethodWithUsernamePasswordParameters(parameters)) {
397
- throw new Error('The grant type password requires the parameters username and password');
398
- }
399
- }
400
- function AssertOAuthMethodWithRefreshTokenParameters(parameters) {
401
- if (!IsOAuthMethodWithRefreshTokenParameters(parameters)) {
402
- throw new Error('The grant type refresh token requires the parameters refreshToken');
403
- }
404
- }
405
- function AssertOAuthMethodParameters(parameters) {
406
- if (!parameters.authEndpoint) {
407
- throw new Error('The authEndpoint parameter must be defined');
408
- }
409
- if (!parameters.secret) {
410
- throw new Error('The secret parameter must be defined');
411
- }
412
- if (parameters.grantType) {
413
- switch (parameters.grantType) {
414
- case 'password':
415
- AssertOAuthMethodWithUsernamePasswordParameters(parameters);
416
- break;
417
- case 'refresh_token':
418
- AssertOAuthMethodWithRefreshTokenParameters(parameters);
419
- break;
420
- default:
421
- throw new Error("The grant type '" + parameters.grantType + "' is not supported");
422
- }
423
- }
424
- else {
425
- if (!IsOAuthMethodWithRefreshTokenParameters(parameters) &&
426
- !IsOAuthMethodWithUsernamePasswordParameters(parameters)) {
427
- throw new Error('Either the refresh token or the username and password must be defined');
428
- }
429
- }
430
- }
431
- var OAuthMethod = /** @class */ (function () {
432
- function OAuthMethod(http) {
433
- this.http = http;
434
- }
435
- OAuthMethod.prototype.call = function (parameters) {
436
- var _a;
437
- return __awaiter(this, void 0, void 0, function () {
438
- var params, grantType, headers, response;
439
- return __generator(this, function (_b) {
440
- switch (_b.label) {
441
- case 0:
442
- AssertOAuthMethodParameters(parameters);
443
- params = new URLSearchParams();
444
- grantType = this.getGrantType(parameters);
445
- params.append('grant_type', grantType);
446
- switch (grantType) {
447
- case 'password':
448
- AssertOAuthMethodWithUsernamePasswordParameters(parameters);
449
- params.append('username', parameters.username);
450
- params.append('password', parameters.password);
451
- break;
452
- case 'refresh_token':
453
- AssertOAuthMethodWithRefreshTokenParameters(parameters);
454
- params.append('refresh_token', parameters.refreshToken);
455
- break;
456
- default:
457
- throw new Error('Not supported grant type');
458
- }
459
- headers = new i1.HttpHeaders();
460
- headers = headers.append('Content-type', 'application/x-www-form-urlencoded; charset=utf-8');
461
- if (parameters.secret && parameters.clientId) {
462
- params.append('client_id', parameters.clientId);
463
- params.append('client_secret', parameters.secret);
464
- }
465
- else {
466
- headers = headers.append('Authorization', "Basic " + parameters.secret);
467
- }
468
- return [4 /*yield*/, this.http
469
- .post(parameters.authEndpoint, params.toString(), {
470
- headers: headers,
471
- withCredentials: (_a = parameters.withCredentials) !== null && _a !== void 0 ? _a : true,
472
- })
473
- .toPromise()];
474
- case 1:
475
- response = _b.sent();
476
- return [2 /*return*/, {
477
- accessToken: response.access_token,
478
- refreshToken: response.refresh_token,
479
- expiresIn: response.expires_in,
480
- expiresAt: new Date(Date.now() + response.expires_in * 1000),
481
- }];
482
- }
483
- });
484
- });
485
- };
486
- OAuthMethod.prototype.getGrantType = function (parameters) {
487
- if (parameters.grantType) {
488
- return parameters.grantType;
489
- }
490
- if (IsOAuthMethodWithRefreshTokenParameters(parameters)) {
491
- return 'refresh_token';
492
- }
493
- if (IsOAuthMethodWithUsernamePasswordParameters(parameters)) {
494
- return 'password';
495
- }
496
- throw new Error('Could not guess the grant type');
497
- };
498
- return OAuthMethod;
499
- }());
500
- OAuthMethod.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthMethod, deps: [{ token: i1.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
501
- OAuthMethod.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthMethod, providedIn: 'root' });
502
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthMethod, decorators: [{
503
- type: i0.Injectable,
504
- args: [{ providedIn: 'root' }]
505
- }], ctorParameters: function () {
506
- return [{ type: i1__namespace.HttpClient, decorators: [{
507
- type: i0.Inject,
508
- args: [i1.HttpClient]
509
- }] }];
510
- } });
511
-
512
- function DefaultRedirectSignInFactory() {
513
- return ['/', 'authentication', 'login'];
514
- }
515
- var RXAP_O_AUTH_REDIRECT_SIGN_IN = new i0.InjectionToken('rxap/o-auth/redirect-sign-in', {
516
- providedIn: 'root',
517
- factory: DefaultRedirectSignInFactory
518
- });
519
- var RXAP_O_AUTH_REDIRECT_SIGN_OUT = new i0.InjectionToken('rxap/o-auth/redirect-sign-out');
520
- function DefaultRedirectUrl() {
521
- return location.origin + '/oauth';
522
- }
523
- var RXAP_O_AUTH_REDIRECT_URL = new i0.InjectionToken('rxap/o-auth/redirect-url', {
524
- providedIn: 'root',
525
- factory: DefaultRedirectUrl
526
- });
527
-
528
- var OAUTH_SECRET = new i0.InjectionToken('OAUTH_SECRET');
529
- var OAUTH_AUTH_ENDPOINT = new i0.InjectionToken('OAUTH_AUTH_ENDPOINT');
530
- var OAUTH_SSO_URL = new i0.InjectionToken('OAUTH_SSO_URL');
531
- var OAUTH_CLIENT_ID = new i0.InjectionToken('OAUTH_CLIENT_ID');
532
- var ACCESS_TOKEN_LOCAL_STORAGE_KEY = 'access_token';
533
- var REFRESH_TOKEN_LOCAL_STORAGE_KEY = 'refresh_token';
534
- var EXPIRES_AT_LOCAL_STORAGE_KEY = 'expires_at';
535
- var REMEMBER_LOCAL_STORAGE_KEY = 'remember';
536
- var OAuthService = /** @class */ (function () {
537
- function OAuthService(oAuthMethod, getOAuthProfileMethod, router, profileEndpoint, authEndpoint, secret, ssoUrl, redirectSignOut, redirectUrl, clientId) {
538
- if (profileEndpoint === void 0) { profileEndpoint = null; }
539
- if (authEndpoint === void 0) { authEndpoint = null; }
540
- if (secret === void 0) { secret = null; }
541
- if (ssoUrl === void 0) { ssoUrl = null; }
542
- if (redirectSignOut === void 0) { redirectSignOut = null; }
543
- if (redirectUrl === void 0) { redirectUrl = null; }
544
- if (clientId === void 0) { clientId = null; }
545
- this.oAuthMethod = oAuthMethod;
546
- this.getOAuthProfileMethod = getOAuthProfileMethod;
547
- this.router = router;
548
- this.profileEndpoint = profileEndpoint;
549
- this.authEndpoint = authEndpoint;
550
- this.secret = secret;
551
- this.ssoUrl = ssoUrl;
552
- this.redirectSignOut = redirectSignOut;
553
- this.redirectUrl = redirectUrl;
554
- this.clientId = clientId;
555
- this.events$ = new rxjs.ReplaySubject();
556
- this._isAuthenticated = null;
557
- }
558
- Object.defineProperty(OAuthService.prototype, "expiresAt", {
559
- get: function () {
560
- var expiresAt = this.getItem(EXPIRES_AT_LOCAL_STORAGE_KEY);
561
- if (expiresAt) {
562
- return new Date(parseInt(this.getItem(EXPIRES_AT_LOCAL_STORAGE_KEY), 10));
563
- }
564
- return null;
565
- },
566
- set: function (value) {
567
- if (value) {
568
- this.setItem(EXPIRES_AT_LOCAL_STORAGE_KEY, value.getTime().toFixed(0));
569
- }
570
- else {
571
- this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);
572
- }
573
- },
574
- enumerable: false,
575
- configurable: true
576
- });
577
- Object.defineProperty(OAuthService.prototype, "refreshToken", {
578
- get: function () {
579
- return this.getItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);
580
- },
581
- set: function (value) {
582
- if (value) {
583
- this.setItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY, value);
584
- }
585
- else {
586
- this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);
587
- }
588
- },
589
- enumerable: false,
590
- configurable: true
591
- });
592
- Object.defineProperty(OAuthService.prototype, "accessToken", {
593
- get: function () {
594
- return this.getItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);
595
- },
596
- set: function (value) {
597
- if (value) {
598
- this.setItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY, value);
599
- }
600
- else {
601
- this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);
602
- }
603
- },
604
- enumerable: false,
605
- configurable: true
606
- });
607
- Object.defineProperty(OAuthService.prototype, "expiresIn", {
608
- /**
609
- * The time until the access token expires in seconds
610
- */
611
- get: function () {
612
- var expiresAt = this.expiresAt;
613
- if (expiresAt) {
614
- return Math.round((expiresAt.getTime() - Date.now()) / 1000);
615
- }
616
- return null;
617
- },
618
- enumerable: false,
619
- configurable: true
620
- });
621
- Object.defineProperty(OAuthService.prototype, "remember", {
622
- get: function () {
623
- return !!this.getItem(REMEMBER_LOCAL_STORAGE_KEY);
624
- },
625
- set: function (value) {
626
- if (value) {
627
- this.setItem(REMEMBER_LOCAL_STORAGE_KEY, 'true');
628
- }
629
- else {
630
- this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);
631
- }
632
- },
633
- enumerable: false,
634
- configurable: true
635
- });
636
- Object.defineProperty(OAuthService.prototype, "profile", {
637
- get: function () {
638
- return this._profile;
639
- },
640
- enumerable: false,
641
- configurable: true
642
- });
643
- OAuthService.prototype.signInWithRedirect = function (lastUrl) {
644
- if (!this.redirectUrl) {
645
- throw new Error('Redirect url is not defined');
646
- }
647
- location.replace(this.ssoUrl + "?redirect=" + btoa(this.redirectUrl) + "&secret=" + this.secret + "&payload=" + btoa(JSON.stringify({ lastUrl: lastUrl })));
648
- };
649
- OAuthService.prototype.isAuthenticated = function () {
650
- var _a;
651
- return __awaiter(this, void 0, void 0, function () {
652
- var profile, e_1;
653
- return __generator(this, function (_c) {
654
- switch (_c.label) {
655
- case 0:
656
- if (!this.secret) {
657
- throw new Error('The oauth secret is not defined');
658
- }
659
- if (!this.authEndpoint) {
660
- throw new Error('The oauth auth endpoint is not defined');
661
- }
662
- if (this._isAuthenticated !== null) {
663
- return [2 /*return*/, this._isAuthenticated];
664
- }
665
- if (!this.accessToken) return [3 /*break*/, 3];
666
- console.debug('Access token is defined: ' + this.accessToken);
667
- if (!(this.expiresIn && this.expiresIn > 60)) return [3 /*break*/, 2];
668
- return [4 /*yield*/, this.getProfile()];
669
- case 1:
670
- profile = _c.sent();
671
- if (!profile) {
672
- console.log('profile is not defined');
673
- return [2 /*return*/, (this._isAuthenticated = false)];
674
- }
675
- this.authenticated({
676
- refreshToken: this.refreshToken,
677
- accessToken: this.accessToken,
678
- expiresAt: (_a = this.expiresAt) !== null && _a !== void 0 ? _a : new Date(Date.now() + 60 * 1000),
679
- expiresIn: this.expiresIn,
680
- }, this.remember);
681
- return [2 /*return*/, (this._isAuthenticated = true)];
682
- case 2:
683
- this.accessToken = null;
684
- this.expiresAt = null;
685
- console.warn('The access token expires soon. Use refresh token instead.');
686
- _c.label = 3;
687
- case 3:
688
- if (!this.refreshToken) return [3 /*break*/, 7];
689
- console.debug('Refresh token is defined: ' + this.refreshToken);
690
- _c.label = 4;
691
- case 4:
692
- _c.trys.push([4, 6, , 7]);
693
- return [4 /*yield*/, this.signInWithRefreshToken(this.refreshToken)];
694
- case 5:
695
- _c.sent();
696
- return [2 /*return*/, (this._isAuthenticated = true)];
697
- case 6:
698
- e_1 = _c.sent();
699
- if (![401, 403, 400].includes(e_1.status)) {
700
- console.error('Could not sign in with refresh token', e_1.message);
701
- throw e_1;
702
- }
703
- console.warn('Refresh token is expired');
704
- return [3 /*break*/, 7];
705
- case 7:
706
- console.warn('Unauthenticated');
707
- return [2 /*return*/, (this._isAuthenticated = false)];
708
- }
709
- });
710
- });
711
- };
712
- OAuthService.prototype.signInWithEmailAndPassword = function (email, password, remember) {
713
- var _a;
714
- return __awaiter(this, void 0, void 0, function () {
715
- var response;
716
- var _this = this;
717
- return __generator(this, function (_c) {
718
- switch (_c.label) {
719
- case 0:
720
- if (!this.secret) {
721
- throw new Error('The oauth secret is not defined');
722
- }
723
- if (!this.authEndpoint) {
724
- throw new Error('The oauth auth endpoint is not defined');
725
- }
726
- return [4 /*yield*/, this.oAuthMethod.call({
727
- username: email,
728
- password: password,
729
- authEndpoint: this.authEndpoint,
730
- secret: this.secret,
731
- clientId: (_a = this.clientId) !== null && _a !== void 0 ? _a : undefined
732
- }).catch(function (e) {
733
- _this.events$.next({ type: authentication.AuthenticationEventType.OnAuthError });
734
- throw e;
735
- })];
736
- case 1:
737
- response = _c.sent();
738
- this.authenticated(response, remember);
739
- return [2 /*return*/, response];
740
- }
741
- });
742
- });
743
- };
744
- OAuthService.prototype.getProfile = function () {
745
- return __awaiter(this, void 0, void 0, function () {
746
- var profile, e_2;
747
- return __generator(this, function (_c) {
748
- switch (_c.label) {
749
- case 0:
750
- profile = null;
751
- if (!this.accessToken) {
752
- throw new Error('The access token is not defined');
753
- }
754
- if (!this.profileEndpoint) return [3 /*break*/, 5];
755
- _c.label = 1;
756
- case 1:
757
- _c.trys.push([1, 3, , 4]);
758
- return [4 /*yield*/, this.getOAuthProfileMethod.call({
759
- accessToken: this.accessToken,
760
- profileEndpoint: this.profileEndpoint,
761
- })];
762
- case 2:
763
- profile = _c.sent();
764
- return [3 /*break*/, 4];
765
- case 3:
766
- e_2 = _c.sent();
767
- console.error('Could not request the user profile', e_2.message);
768
- return [3 /*break*/, 4];
769
- case 4: return [3 /*break*/, 6];
770
- case 5:
771
- console.warn('The profile endpoint is not defined!');
772
- _c.label = 6;
773
- case 6: return [2 /*return*/, (this._profile = profile)];
774
- }
775
- });
776
- });
777
- };
778
- OAuthService.prototype.signOut = function () {
779
- return __awaiter(this, void 0, void 0, function () {
780
- return __generator(this, function (_c) {
781
- switch (_c.label) {
782
- case 0:
783
- this.clearStorage();
784
- this.accessToken = null;
785
- this.refreshToken = null;
786
- this.expiresAt = null;
787
- this._isAuthenticated = false;
788
- if (!this.redirectSignOut) return [3 /*break*/, 2];
789
- return [4 /*yield*/, this.router.navigate(this.redirectSignOut)];
790
- case 1:
791
- _c.sent();
792
- return [3 /*break*/, 3];
793
- case 2:
794
- if (!this.redirectUrl) {
795
- throw new Error('Redirect url is not defined');
796
- }
797
- location.replace(this.ssoUrl + "?redirect=" + btoa(this.redirectUrl) + "&secret=" + this.secret + "&action=signOut");
798
- _c.label = 3;
799
- case 3:
800
- this.events$.next({ type: authentication.AuthenticationEventType.OnLogout });
801
- return [2 /*return*/];
802
- }
803
- });
804
- });
805
- };
806
- OAuthService.prototype.authenticated = function (response, remember) {
807
- var _a, _b;
808
- if (remember === void 0) {
809
- remember = (_a = this.remember) !== null && _a !== void 0 ? _a : false;
810
- }
811
- this.accessToken = response.accessToken;
812
- this.refreshToken = (_b = response.refreshToken) !== null && _b !== void 0 ? _b : null;
813
- this.expiresAt = response.expiresAt;
814
- console.log("Authenticated until " + this.expiresAt.toISOString());
815
- this.remember = remember;
816
- if (remember) {
817
- this.setItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY, response.accessToken);
818
- if (response.refreshToken) {
819
- this.setItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY, response.refreshToken);
820
- }
821
- this.setItem(REMEMBER_LOCAL_STORAGE_KEY, 'true');
822
- if (response.expiresAt) {
823
- console.log("Authenticated until " + response.expiresAt.toISOString());
824
- this.setItem(EXPIRES_AT_LOCAL_STORAGE_KEY, response.expiresAt.getTime().toFixed(0));
825
- }
826
- }
827
- else {
828
- this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);
829
- this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);
830
- this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);
831
- this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);
832
- }
833
- this._isAuthenticated = true;
834
- this.events$.next({ type: authentication.AuthenticationEventType.OnAuthSuccess });
835
- };
836
- OAuthService.prototype.getKey = function (key) {
837
- return [this.secret, key].join('__');
838
- };
839
- OAuthService.prototype.getItem = function (key) {
840
- return localStorage.getItem(this.getKey(key));
841
- };
842
- OAuthService.prototype.setItem = function (key, value) {
843
- localStorage.setItem(this.getKey(key), value);
844
- };
845
- OAuthService.prototype.removeItem = function (key) {
846
- localStorage.removeItem(this.getKey(key));
847
- };
848
- OAuthService.prototype.clearStorage = function () {
849
- this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);
850
- this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);
851
- this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);
852
- this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);
853
- };
854
- OAuthService.prototype.signInWithRefreshToken = function (refreshToken) {
855
- var _a;
856
- return __awaiter(this, void 0, void 0, function () {
857
- var response;
858
- return __generator(this, function (_c) {
859
- switch (_c.label) {
860
- case 0:
861
- if (!this.secret) {
862
- throw new Error('The oauth secret is not defined');
863
- }
864
- if (!this.authEndpoint) {
865
- throw new Error('The oauth auth endpoint is not defined');
866
- }
867
- return [4 /*yield*/, this.oAuthMethod.call({
868
- refreshToken: refreshToken,
869
- authEndpoint: this.authEndpoint,
870
- secret: this.secret,
871
- clientId: (_a = this.clientId) !== null && _a !== void 0 ? _a : undefined,
872
- })];
873
- case 1:
874
- response = _c.sent();
875
- this.authenticated(response);
876
- return [2 /*return*/, response];
877
- }
878
- });
879
- });
880
- };
881
- return OAuthService;
882
- }());
883
- OAuthService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthService, deps: [{ token: OAuthMethod }, { token: GetOAuthProfileMethod }, { token: i1$1.Router }, { token: PROFILE_AUTH_ENDPOINT, optional: true }, { token: OAUTH_AUTH_ENDPOINT, optional: true }, { token: OAUTH_SECRET, optional: true }, { token: OAUTH_SSO_URL, optional: true }, { token: RXAP_O_AUTH_REDIRECT_SIGN_OUT, optional: true }, { token: RXAP_O_AUTH_REDIRECT_URL, optional: true }, { token: OAUTH_CLIENT_ID, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
884
- OAuthService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthService, providedIn: 'root' });
885
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthService, decorators: [{
886
- type: i0.Injectable,
887
- args: [{ providedIn: 'root' }]
888
- }], ctorParameters: function () {
889
- return [{ type: OAuthMethod, decorators: [{
890
- type: i0.Inject,
891
- args: [OAuthMethod]
892
- }] }, { type: GetOAuthProfileMethod, decorators: [{
893
- type: i0.Inject,
894
- args: [GetOAuthProfileMethod]
895
- }] }, { type: i1__namespace$1.Router, decorators: [{
896
- type: i0.Inject,
897
- args: [i1$1.Router]
898
- }] }, { type: undefined, decorators: [{
899
- type: i0.Optional
900
- }, {
901
- type: i0.Inject,
902
- args: [PROFILE_AUTH_ENDPOINT]
903
- }] }, { type: undefined, decorators: [{
904
- type: i0.Optional
905
- }, {
906
- type: i0.Inject,
907
- args: [OAUTH_AUTH_ENDPOINT]
908
- }] }, { type: undefined, decorators: [{
909
- type: i0.Optional
910
- }, {
911
- type: i0.Inject,
912
- args: [OAUTH_SECRET]
913
- }] }, { type: undefined, decorators: [{
914
- type: i0.Optional
915
- }, {
916
- type: i0.Inject,
917
- args: [OAUTH_SSO_URL]
918
- }] }, { type: undefined, decorators: [{
919
- type: i0.Optional
920
- }, {
921
- type: i0.Inject,
922
- args: [RXAP_O_AUTH_REDIRECT_SIGN_OUT]
923
- }] }, { type: undefined, decorators: [{
924
- type: i0.Optional
925
- }, {
926
- type: i0.Inject,
927
- args: [RXAP_O_AUTH_REDIRECT_URL]
928
- }] }, { type: undefined, decorators: [{
929
- type: i0.Optional
930
- }, {
931
- type: i0.Inject,
932
- args: [OAUTH_CLIENT_ID]
933
- }] }];
934
- } });
935
-
936
- var OAuthExtractGuard = /** @class */ (function () {
937
- function OAuthExtractGuard(router, oAuthService) {
938
- this.router = router;
939
- this.oAuthService = oAuthService;
940
- }
941
- OAuthExtractGuard.prototype.canActivate = function (route) {
942
- if (route.queryParamMap.has('accessToken') && route.queryParamMap.has('refreshToken') && route.queryParamMap.has('expiresIn')) {
943
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
944
- var accessToken = route.queryParamMap.get('accessToken');
945
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
946
- var refreshToken = route.queryParamMap.get('refreshToken');
947
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
948
- var expiresIn = parseInt(route.queryParamMap.get('expiresIn'), 10);
949
- var payloadBase64 = route.queryParamMap.get('payload');
950
- var expiresAt = new Date(Date.now() + expiresIn * 1000);
951
- this.oAuthService.authenticated({
952
- accessToken: accessToken,
953
- refreshToken: refreshToken,
954
- expiresIn: expiresIn,
955
- expiresAt: expiresAt
956
- }, true);
957
- var redirectUrl = '/';
958
- if (payloadBase64) {
959
- try {
960
- var payload = JSON.parse(atob(payloadBase64));
961
- console.debug('sso redirect payload', payload);
962
- if (payload.lastUrl) {
963
- redirectUrl = payload.lastUrl;
964
- }
965
- }
966
- catch (e) {
967
- console.error('Could not parse redirect payload', e.message);
968
- }
969
- }
970
- return this.router.createUrlTree([redirectUrl]);
971
- }
972
- else {
973
- console.warn('Not every query parameter is defined!');
974
- }
975
- return this.router.createUrlTree(__spreadArray(__spreadArray([], __read(route.url.map(function (url) { return url.path; }))), ['redirect']));
976
- };
977
- return OAuthExtractGuard;
978
- }());
979
- OAuthExtractGuard.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthExtractGuard, deps: [{ token: i1__namespace$1.Router }, { token: OAuthService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
980
- OAuthExtractGuard.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthExtractGuard, providedIn: 'root' });
981
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthExtractGuard, decorators: [{
982
- type: i0.Injectable,
983
- args: [{ providedIn: 'root' }]
984
- }], ctorParameters: function () { return [{ type: i1__namespace$1.Router }, { type: OAuthService }]; } });
985
-
986
- var OAuthRedirectGuard = /** @class */ (function () {
987
- function OAuthRedirectGuard(oAuthService) {
988
- this.oAuthService = oAuthService;
989
- }
990
- OAuthRedirectGuard.prototype.canActivate = function (route, state) {
991
- return __awaiter(this, void 0, void 0, function () {
992
- var isAuthenticated;
993
- return __generator(this, function (_a) {
994
- switch (_a.label) {
995
- case 0: return [4 /*yield*/, this.oAuthService.isAuthenticated()];
996
- case 1:
997
- isAuthenticated = _a.sent();
998
- console.log("isAuthenticated: " + isAuthenticated);
999
- if (isAuthenticated) {
1000
- return [2 /*return*/, true];
1001
- }
1002
- this.oAuthService.signInWithRedirect(state.url);
1003
- return [2 /*return*/, false];
1004
- }
1005
- });
1006
- });
1007
- };
1008
- OAuthRedirectGuard.prototype.canActivateChild = function (childRoute, state) {
1009
- return this.canActivate(childRoute, state);
1010
- };
1011
- return OAuthRedirectGuard;
1012
- }());
1013
- OAuthRedirectGuard.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthRedirectGuard, deps: [{ token: OAuthService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1014
- OAuthRedirectGuard.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthRedirectGuard, providedIn: 'root' });
1015
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthRedirectGuard, decorators: [{
1016
- type: i0.Injectable,
1017
- args: [{ providedIn: 'root' }]
1018
- }], ctorParameters: function () {
1019
- return [{ type: OAuthService, decorators: [{
1020
- type: i0.Inject,
1021
- args: [OAuthService]
1022
- }] }];
1023
- } });
1024
-
1025
- var OAuthModule = /** @class */ (function () {
1026
- function OAuthModule() {
1027
- }
1028
- OAuthModule.forRoot = function (options) {
1029
- if (options === void 0) { options = {}; }
1030
- var _a, _b;
1031
- return {
1032
- ngModule: OAuthModule,
1033
- providers: [
1034
- {
1035
- provide: RXAP_O_AUTH_REDIRECT_SIGN_IN,
1036
- useValue: (_a = options.signInPath) !== null && _a !== void 0 ? _a : ['/', 'oauth', 'redirect']
1037
- },
1038
- {
1039
- provide: RXAP_O_AUTH_REDIRECT_SIGN_OUT,
1040
- useValue: (_b = options.signOutPath) !== null && _b !== void 0 ? _b : null
1041
- }
1042
- ]
1043
- };
1044
- };
1045
- return OAuthModule;
1046
- }());
1047
- OAuthModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1048
- OAuthModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthModule });
1049
- OAuthModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthModule });
1050
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthModule, decorators: [{
1051
- type: i0.NgModule
1052
- }] });
1053
-
1054
- var ContainerComponent = /** @class */ (function () {
1055
- function ContainerComponent() {
1056
- }
1057
- ContainerComponent.prototype.prepareRoute = function (outlet) {
1058
- return outlet.isActivated ? outlet.activatedRoute : 'true';
1059
- };
1060
- return ContainerComponent;
1061
- }());
1062
- ContainerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContainerComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1063
- ContainerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContainerComponent, selector: "rxap-container", host: { classAttribute: "rxap-container" }, ngImport: i0__namespace, template: "<div [@routeAnimations]=\"prepareRoute(outlet)\" class=\"container\">\n\n <div class=\"split mat-elevation-z3\"></div>\n\n <router-outlet #outlet=\"outlet\"></router-outlet>\n\n</div>\n", styles: [".container{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center}.container .split{position:absolute;top:0;left:0;right:0;bottom:65vh;z-index:-10}"], directives: [{ type: i1__namespace$1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate"], exportAs: ["outlet"] }], animations: [
1064
- animations.trigger('routeAnimations', [
1065
- animations.transition(':enter', [
1066
- animations.style({ opacity: 0 }),
1067
- animations.animate('512ms', animations.style({ opacity: 1 }))
1068
- ]),
1069
- animations.transition(':leave', [
1070
- animations.style({ opacity: 1 }),
1071
- animations.animate('512ms', animations.style({ opacity: 0 }))
1072
- ])
1073
- ])
1074
- ], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1075
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContainerComponent, decorators: [{
1076
- type: i0.Component,
1077
- args: [{
1078
- selector: 'rxap-container',
1079
- templateUrl: './container.component.html',
1080
- styleUrls: ['./container.component.scss'],
1081
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1082
- host: { class: 'rxap-container' },
1083
- animations: [
1084
- animations.trigger('routeAnimations', [
1085
- animations.transition(':enter', [
1086
- animations.style({ opacity: 0 }),
1087
- animations.animate('512ms', animations.style({ opacity: 1 }))
1088
- ]),
1089
- animations.transition(':leave', [
1090
- animations.style({ opacity: 1 }),
1091
- animations.animate('512ms', animations.style({ opacity: 0 }))
1092
- ])
1093
- ])
1094
- ]
1095
- }]
1096
- }] });
1097
-
1098
- var LoadingComponent = /** @class */ (function () {
1099
- function LoadingComponent() {
1100
- }
1101
- return LoadingComponent;
1102
- }());
1103
- LoadingComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LoadingComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1104
- LoadingComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LoadingComponent, selector: "rxap-loading", host: { classAttribute: "rxap-loading" }, ngImport: i0__namespace, template: "<mat-progress-bar class=\"loading-bar\" mode=\"indeterminate\"></mat-progress-bar>\n", styles: [""], components: [{ type: i1__namespace$2.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "mode", "value", "bufferValue"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1105
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LoadingComponent, decorators: [{
1106
- type: i0.Component,
1107
- args: [{
1108
- selector: 'rxap-loading',
1109
- templateUrl: './loading.component.html',
1110
- styleUrls: ['./loading.component.scss'],
1111
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1112
- host: { class: 'rxap-loading' }
1113
- }]
1114
- }] });
1115
-
1116
- var SignInWithRedirectComponent = /** @class */ (function () {
1117
- function SignInWithRedirectComponent(authService) {
1118
- this.authService = authService;
1119
- }
1120
- SignInWithRedirectComponent.prototype.signIn = function () {
1121
- this.authService.signInWithRedirect();
1122
- };
1123
- return SignInWithRedirectComponent;
1124
- }());
1125
- SignInWithRedirectComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SignInWithRedirectComponent, deps: [{ token: OAuthService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1126
- SignInWithRedirectComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SignInWithRedirectComponent, selector: "rxap-sign-in-with-redirect", host: { classAttribute: "rxap-sign-in-with-redirect" }, ngImport: i0__namespace, template: "<div [@fadeAnimation]=\"'in'\" class=\"inner mat-elevation-z5\" fxLayout=\"column\" fxLayoutAlign=\"center center\" fxLayoutGap=\"32px\">\n\n <div class=\"header\" fxFlex=\"nogrow\" fxLayout=\"column\" fxLayoutAlign=\"center center\">\n\n <mat-icon class=\"avatar-icon\" color=\"primary\" fxFlex=\"nogrow\">account_circle</mat-icon>\n\n </div>\n\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n\n <div fxFlex=\"nogrow\">\n <button (click)=\"signIn()\" color=\"primary\" fxFlex=\"nogrow\" mat-raised-button>\n <span fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"16px\">\n <mat-icon fxFlex=\"nogrow\">login</mat-icon>\n <span fxFlex=\"nogrow\">Sign In</span>\n </span>\n </button>\n </div>\n\n </div>\n\n</div>\n\n", styles: [".inner{padding:64px;position:relative}.inner .header .avatar-icon{width:100px;height:100px;font-size:100px}"], components: [{ type: i2__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i3__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i4__namespace.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i4__namespace.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i4__namespace.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { type: i4__namespace.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }], animations: [
1127
- animations.trigger('fadeAnimation', [
1128
- // the "in" style determines the "resting" state of the element when it is visible.
1129
- animations.state('in', animations.style({ opacity: 1 })),
1130
- // fade in when created. this could also be written as transition('void => *')
1131
- animations.transition(':enter', [
1132
- animations.style({ opacity: 0 }),
1133
- animations.animate(300)
1134
- ]),
1135
- // fade out when destroyed. this could also be written as transition('void => *')
1136
- animations.transition(':leave', animations.animate(300, animations.style({ opacity: 0 })))
1137
- ])
1138
- ], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1139
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SignInWithRedirectComponent, decorators: [{
1140
- type: i0.Component,
1141
- args: [{
1142
- selector: 'rxap-sign-in-with-redirect',
1143
- templateUrl: './sign-in-with-redirect.component.html',
1144
- styleUrls: ['./sign-in-with-redirect.component.scss'],
1145
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1146
- host: { class: 'rxap-sign-in-with-redirect' },
1147
- animations: [
1148
- animations.trigger('fadeAnimation', [
1149
- // the "in" style determines the "resting" state of the element when it is visible.
1150
- animations.state('in', animations.style({ opacity: 1 })),
1151
- // fade in when created. this could also be written as transition('void => *')
1152
- animations.transition(':enter', [
1153
- animations.style({ opacity: 0 }),
1154
- animations.animate(300)
1155
- ]),
1156
- // fade out when destroyed. this could also be written as transition('void => *')
1157
- animations.transition(':leave', animations.animate(300, animations.style({ opacity: 0 })))
1158
- ])
1159
- ]
1160
- }]
1161
- }], ctorParameters: function () { return [{ type: OAuthService }]; } });
1162
-
1163
- var RXAP_O_AUTH_ROUTES = [
1164
- {
1165
- path: 'oauth',
1166
- component: ContainerComponent,
1167
- children: [
1168
- {
1169
- path: 'redirect',
1170
- component: SignInWithRedirectComponent
1171
- },
1172
- {
1173
- canActivate: [OAuthExtractGuard],
1174
- path: '',
1175
- component: LoadingComponent
1176
- },
1177
- {
1178
- path: '**',
1179
- redirectTo: ''
1180
- }
1181
- ]
1182
- }
1183
- ];
1184
-
1185
- var ProfileResolve = /** @class */ (function () {
1186
- function ProfileResolve(oAuthService, router, redirectLogin) {
1187
- this.oAuthService = oAuthService;
1188
- this.router = router;
1189
- this.redirectLogin = redirectLogin;
1190
- }
1191
- ProfileResolve.prototype.resolve = function () {
1192
- return __awaiter(this, void 0, void 0, function () {
1193
- var profile;
1194
- return __generator(this, function (_a) {
1195
- switch (_a.label) {
1196
- case 0: return [4 /*yield*/, this.oAuthService.getProfile()];
1197
- case 1:
1198
- profile = _a.sent();
1199
- if (!!profile) return [3 /*break*/, 3];
1200
- return [4 /*yield*/, this.router.navigate(this.redirectLogin)];
1201
- case 2:
1202
- _a.sent();
1203
- _a.label = 3;
1204
- case 3: return [2 /*return*/, profile];
1205
- }
1206
- });
1207
- });
1208
- };
1209
- return ProfileResolve;
1210
- }());
1211
- ProfileResolve.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ProfileResolve, deps: [{ token: OAuthService }, { token: i1$1.Router }, { token: RXAP_O_AUTH_REDIRECT_SIGN_IN }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1212
- ProfileResolve.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ProfileResolve, providedIn: 'root' });
1213
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ProfileResolve, decorators: [{
1214
- type: i0.Injectable,
1215
- args: [{ providedIn: 'root' }]
1216
- }], ctorParameters: function () {
1217
- return [{ type: OAuthService, decorators: [{
1218
- type: i0.Inject,
1219
- args: [OAuthService]
1220
- }] }, { type: i1__namespace$1.Router, decorators: [{
1221
- type: i0.Inject,
1222
- args: [i1$1.Router]
1223
- }] }, { type: undefined, decorators: [{
1224
- type: i0.Inject,
1225
- args: [RXAP_O_AUTH_REDIRECT_SIGN_IN]
1226
- }] }];
1227
- } });
1228
-
1229
- var ContainerComponentModule = /** @class */ (function () {
1230
- function ContainerComponentModule() {
1231
- }
1232
- return ContainerComponentModule;
1233
- }());
1234
- ContainerComponentModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContainerComponentModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1235
- ContainerComponentModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContainerComponentModule, declarations: [ContainerComponent], imports: [i1$1.RouterModule], exports: [ContainerComponent] });
1236
- ContainerComponentModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContainerComponentModule, imports: [[
1237
- i1$1.RouterModule
1238
- ]] });
1239
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContainerComponentModule, decorators: [{
1240
- type: i0.NgModule,
1241
- args: [{
1242
- declarations: [ContainerComponent],
1243
- imports: [
1244
- i1$1.RouterModule
1245
- ],
1246
- exports: [ContainerComponent]
1247
- }]
1248
- }] });
1249
-
1250
- var LoadingComponentModule = /** @class */ (function () {
1251
- function LoadingComponentModule() {
1252
- }
1253
- return LoadingComponentModule;
1254
- }());
1255
- LoadingComponentModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LoadingComponentModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1256
- LoadingComponentModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LoadingComponentModule, declarations: [LoadingComponent], imports: [i1$2.MatProgressBarModule], exports: [LoadingComponent] });
1257
- LoadingComponentModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LoadingComponentModule, imports: [[
1258
- i1$2.MatProgressBarModule
1259
- ]] });
1260
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LoadingComponentModule, decorators: [{
1261
- type: i0.NgModule,
1262
- args: [{
1263
- declarations: [
1264
- LoadingComponent
1265
- ],
1266
- imports: [
1267
- i1$2.MatProgressBarModule
1268
- ],
1269
- exports: [
1270
- LoadingComponent
1271
- ]
1272
- }]
1273
- }] });
1274
-
1275
- var SignInWithRedirectComponentModule = /** @class */ (function () {
1276
- function SignInWithRedirectComponentModule() {
1277
- }
1278
- return SignInWithRedirectComponentModule;
1279
- }());
1280
- SignInWithRedirectComponentModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SignInWithRedirectComponentModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1281
- SignInWithRedirectComponentModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SignInWithRedirectComponentModule, declarations: [SignInWithRedirectComponent], imports: [card.MatCardModule,
1282
- i3.MatButtonModule,
1283
- flexLayout.FlexLayoutModule,
1284
- i2.MatIconModule,
1285
- common.CommonModule], exports: [SignInWithRedirectComponent] });
1286
- SignInWithRedirectComponentModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SignInWithRedirectComponentModule, imports: [[
1287
- card.MatCardModule,
1288
- i3.MatButtonModule,
1289
- flexLayout.FlexLayoutModule,
1290
- i2.MatIconModule,
1291
- common.CommonModule
1292
- ]] });
1293
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SignInWithRedirectComponentModule, decorators: [{
1294
- type: i0.NgModule,
1295
- args: [{
1296
- declarations: [SignInWithRedirectComponent],
1297
- imports: [
1298
- card.MatCardModule,
1299
- i3.MatButtonModule,
1300
- flexLayout.FlexLayoutModule,
1301
- i2.MatIconModule,
1302
- common.CommonModule
1303
- ],
1304
- exports: [SignInWithRedirectComponent]
1305
- }]
1306
- }] });
1307
-
1308
- var OAuthRoutingModule = /** @class */ (function () {
1309
- function OAuthRoutingModule() {
1310
- }
1311
- return OAuthRoutingModule;
1312
- }());
1313
- OAuthRoutingModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthRoutingModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1314
- OAuthRoutingModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthRoutingModule, exports: [ContainerComponentModule,
1315
- LoadingComponentModule,
1316
- SignInWithRedirectComponentModule] });
1317
- OAuthRoutingModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthRoutingModule, imports: [ContainerComponentModule,
1318
- LoadingComponentModule,
1319
- SignInWithRedirectComponentModule] });
1320
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OAuthRoutingModule, decorators: [{
1321
- type: i0.NgModule,
1322
- args: [{
1323
- exports: [
1324
- ContainerComponentModule,
1325
- LoadingComponentModule,
1326
- SignInWithRedirectComponentModule
1327
- ]
1328
- }]
1329
- }] });
1330
-
1331
- /**
1332
- * Generated bundle index. Do not edit.
1333
- */
1334
-
1335
- exports.ACCESS_TOKEN_LOCAL_STORAGE_KEY = ACCESS_TOKEN_LOCAL_STORAGE_KEY;
1336
- exports.AssertOAuthMethodParameters = AssertOAuthMethodParameters;
1337
- exports.AssertOAuthMethodWithRefreshTokenParameters = AssertOAuthMethodWithRefreshTokenParameters;
1338
- exports.AssertOAuthMethodWithUsernamePasswordParameters = AssertOAuthMethodWithUsernamePasswordParameters;
1339
- exports.ContainerComponent = ContainerComponent;
1340
- exports.ContainerComponentModule = ContainerComponentModule;
1341
- exports.DefaultRedirectSignInFactory = DefaultRedirectSignInFactory;
1342
- exports.DefaultRedirectUrl = DefaultRedirectUrl;
1343
- exports.EXPIRES_AT_LOCAL_STORAGE_KEY = EXPIRES_AT_LOCAL_STORAGE_KEY;
1344
- exports.GetOAuthProfileMethod = GetOAuthProfileMethod;
1345
- exports.IsOAuthMethodWithRefreshTokenParameters = IsOAuthMethodWithRefreshTokenParameters;
1346
- exports.IsOAuthMethodWithUsernamePasswordParameters = IsOAuthMethodWithUsernamePasswordParameters;
1347
- exports.LoadingComponent = LoadingComponent;
1348
- exports.LoadingComponentModule = LoadingComponentModule;
1349
- exports.OAUTH_AUTH_ENDPOINT = OAUTH_AUTH_ENDPOINT;
1350
- exports.OAUTH_CLIENT_ID = OAUTH_CLIENT_ID;
1351
- exports.OAUTH_SECRET = OAUTH_SECRET;
1352
- exports.OAUTH_SSO_URL = OAUTH_SSO_URL;
1353
- exports.OAuthExtractGuard = OAuthExtractGuard;
1354
- exports.OAuthMethod = OAuthMethod;
1355
- exports.OAuthModule = OAuthModule;
1356
- exports.OAuthRedirectGuard = OAuthRedirectGuard;
1357
- exports.OAuthRoutingModule = OAuthRoutingModule;
1358
- exports.OAuthService = OAuthService;
1359
- exports.PROFILE_AUTH_ENDPOINT = PROFILE_AUTH_ENDPOINT;
1360
- exports.ProfileResolve = ProfileResolve;
1361
- exports.REFRESH_TOKEN_LOCAL_STORAGE_KEY = REFRESH_TOKEN_LOCAL_STORAGE_KEY;
1362
- exports.REMEMBER_LOCAL_STORAGE_KEY = REMEMBER_LOCAL_STORAGE_KEY;
1363
- exports.RXAP_O_AUTH_REDIRECT_SIGN_IN = RXAP_O_AUTH_REDIRECT_SIGN_IN;
1364
- exports.RXAP_O_AUTH_REDIRECT_SIGN_OUT = RXAP_O_AUTH_REDIRECT_SIGN_OUT;
1365
- exports.RXAP_O_AUTH_REDIRECT_URL = RXAP_O_AUTH_REDIRECT_URL;
1366
- exports.RXAP_O_AUTH_ROUTES = RXAP_O_AUTH_ROUTES;
1367
- exports.SignInWithRedirectComponent = SignInWithRedirectComponent;
1368
- exports.SignInWithRedirectComponentModule = SignInWithRedirectComponentModule;
1369
-
1370
- Object.defineProperty(exports, '__esModule', { value: true });
1371
-
1372
- }));
1373
- //# sourceMappingURL=rxap-oauth.umd.js.map