@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,85 +0,0 @@
1
- import { __awaiter } from "tslib";
2
- import { OAuthService, OAuthMethod, GetOAuthProfileMethod, PROFILE_AUTH_ENDPOINT, OAUTH_AUTH_ENDPOINT, OAUTH_SECRET, OAUTH_SSO_URL, RXAP_O_AUTH_REDIRECT_SIGN_OUT, RXAP_O_AUTH_REDIRECT_URL } from '@rxap/oauth';
3
- import { Injectable, Inject, Optional } from '@angular/core';
4
- import { Router } from '@angular/router';
5
- import * as i0 from "@angular/core";
6
- import * as i1 from "@rxap/oauth";
7
- import * as i2 from "@angular/router";
8
- export class OAuthSingleSignOnService extends OAuthService {
9
- // It is required to define the constructor with the injection
10
- // definition. If not defined the constructor will be created by
11
- // typescript without an parameters, bc the payload and redirect
12
- // initialization is done in the constructor.
13
- constructor(oAuthMethod, getOAuthProfileMethod, router, profileEndpoint = null, authEndpoint = null, secret = null, ssoUrl = null, redirectSignOut = null, redirectUrl = null) {
14
- super(oAuthMethod, getOAuthProfileMethod, router, profileEndpoint, authEndpoint, secret, ssoUrl, redirectSignOut, redirectUrl);
15
- this.payload = null;
16
- this.redirect = null;
17
- }
18
- signInWithEmailAndPassword(email, password, remember) {
19
- const _super = Object.create(null, {
20
- signInWithEmailAndPassword: { get: () => super.signInWithEmailAndPassword }
21
- });
22
- return __awaiter(this, void 0, void 0, function* () {
23
- const response = yield _super.signInWithEmailAndPassword.call(this, email, password, remember);
24
- this.redirectToClient();
25
- return response;
26
- });
27
- }
28
- redirectToClient() {
29
- window.location.replace(`${this.redirect}?accessToken=${this.accessToken}&refreshToken=${this.refreshToken}&expiresIn=${this.expiresIn}&payload=${this.payload}`);
30
- }
31
- signOut() {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- this.clearStorage();
34
- this.accessToken = null;
35
- this.refreshToken = null;
36
- this.expiresAt = null;
37
- this._isAuthenticated = false;
38
- });
39
- }
40
- }
41
- OAuthSingleSignOnService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OAuthSingleSignOnService, deps: [{ token: OAuthMethod }, { token: GetOAuthProfileMethod }, { token: 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 }], target: i0.ɵɵFactoryTarget.Injectable });
42
- OAuthSingleSignOnService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OAuthSingleSignOnService });
43
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OAuthSingleSignOnService, decorators: [{
44
- type: Injectable
45
- }], ctorParameters: function () { return [{ type: i1.OAuthMethod, decorators: [{
46
- type: Inject,
47
- args: [OAuthMethod]
48
- }] }, { type: i1.GetOAuthProfileMethod, decorators: [{
49
- type: Inject,
50
- args: [GetOAuthProfileMethod]
51
- }] }, { type: i2.Router, decorators: [{
52
- type: Inject,
53
- args: [Router]
54
- }] }, { type: undefined, decorators: [{
55
- type: Optional
56
- }, {
57
- type: Inject,
58
- args: [PROFILE_AUTH_ENDPOINT]
59
- }] }, { type: undefined, decorators: [{
60
- type: Optional
61
- }, {
62
- type: Inject,
63
- args: [OAUTH_AUTH_ENDPOINT]
64
- }] }, { type: undefined, decorators: [{
65
- type: Optional
66
- }, {
67
- type: Inject,
68
- args: [OAUTH_SECRET]
69
- }] }, { type: undefined, decorators: [{
70
- type: Optional
71
- }, {
72
- type: Inject,
73
- args: [OAUTH_SSO_URL]
74
- }] }, { type: undefined, decorators: [{
75
- type: Optional
76
- }, {
77
- type: Inject,
78
- args: [RXAP_O_AUTH_REDIRECT_SIGN_OUT]
79
- }] }, { type: undefined, decorators: [{
80
- type: Optional
81
- }, {
82
- type: Inject,
83
- args: [RXAP_O_AUTH_REDIRECT_URL]
84
- }] }]; } });
85
- //# sourceMappingURL=o-auth-single-sign-on.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"o-auth-single-sign-on.service.js","sourceRoot":"","sources":["../../../../../../libs/oauth/single-sign-on/src/lib/o-auth-single-sign-on.service.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,YAAY,EAEZ,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,6BAA6B,EAC7B,wBAAwB,EACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,UAAU,EACV,MAAM,EACN,QAAQ,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;;;;AAGzC,MAAM,OAAO,wBAAyB,SAAQ,YAAY;IAKxD,8DAA8D;IAC9D,gEAAgE;IAChE,gEAAgE;IAChE,6CAA6C;IAC7C,YAEI,WAAwB,EAExB,qBAA4C,EAE5C,MAAc,EAGd,kBAAiC,IAAI,EAGrC,eAAmC,IAAI,EAGvC,SAAmC,IAAI,EAGvC,SAAmC,IAAI,EAGvC,kBAAmC,IAAI,EAGvC,cAAmC,IAAI;QAEzC,KAAK,CAAC,WAAW,EAAE,qBAAqB,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,CAAC,CAAC;QAjC1H,YAAO,GAAmB,IAAI,CAAC;QAC/B,aAAQ,GAAkB,IAAI,CAAC;IAiCtC,CAAC;IAEY,0BAA0B,CACrC,KAAa,EACb,QAAgB,EAChB,QAAiB;;;;;YAEjB,MAAM,QAAQ,GAAG,MAAM,OAAM,0BAA0B,YAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;YACnF,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACxB,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;IAEM,gBAAgB;QACrB,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,gBAAgB,IAAI,CAAC,WAAW,iBAAiB,IAAI,CAAC,YAAY,cAAc,IAAI,CAAC,SAAS,YAAY,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IACpK,CAAC;IAEY,OAAO;;YAClB,IAAI,CAAC,YAAY,EAAE,CAAC;YACpB,IAAI,CAAC,WAAW,GAAQ,IAAI,CAAC;YAC7B,IAAI,CAAC,YAAY,GAAO,IAAI,CAAC;YAC7B,IAAI,CAAC,SAAS,GAAU,IAAI,CAAC;YAC7B,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;QAChC,CAAC;KAAA;;sHA1DU,wBAAwB,kBAUzB,WAAW,aAEX,qBAAqB,aAErB,MAAM,aAGN,qBAAqB,6BAGrB,mBAAmB,6BAGnB,YAAY,6BAGZ,aAAa,6BAGb,6BAA6B,6BAG7B,wBAAwB;0HAhCvB,wBAAwB;4FAAxB,wBAAwB;kBADpC,UAAU;;0BAWN,MAAM;2BAAC,WAAW;;0BAElB,MAAM;2BAAC,qBAAqB;;0BAE5B,MAAM;2BAAC,MAAM;;0BAEb,QAAQ;;0BACR,MAAM;2BAAC,qBAAqB;;0BAE5B,QAAQ;;0BACR,MAAM;2BAAC,mBAAmB;;0BAE1B,QAAQ;;0BACR,MAAM;2BAAC,YAAY;;0BAEnB,QAAQ;;0BACR,MAAM;2BAAC,aAAa;;0BAEpB,QAAQ;;0BACR,MAAM;2BAAC,6BAA6B;;0BAEpC,QAAQ;;0BACR,MAAM;2BAAC,wBAAwB","sourcesContent":["import {\n OAuthService,\n OAuthMethodResponse,\n OAuthMethod,\n GetOAuthProfileMethod,\n PROFILE_AUTH_ENDPOINT,\n OAUTH_AUTH_ENDPOINT,\n OAUTH_SECRET,\n OAUTH_SSO_URL,\n RXAP_O_AUTH_REDIRECT_SIGN_OUT,\n RXAP_O_AUTH_REDIRECT_URL\n} from '@rxap/oauth';\nimport {\n Injectable,\n Inject,\n Optional\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\n@Injectable()\nexport class OAuthSingleSignOnService extends OAuthService {\n\n public payload: string | null = null;\n public redirect: string | null = null;\n\n // It is required to define the constructor with the injection\n // definition. If not defined the constructor will be created by\n // typescript without an parameters, bc the payload and redirect\n // initialization is done in the constructor.\n constructor(\n @Inject(OAuthMethod)\n oAuthMethod: OAuthMethod,\n @Inject(GetOAuthProfileMethod)\n getOAuthProfileMethod: GetOAuthProfileMethod,\n @Inject(Router)\n router: Router,\n @Optional()\n @Inject(PROFILE_AUTH_ENDPOINT)\n profileEndpoint: string | null = null,\n @Optional()\n @Inject(OAUTH_AUTH_ENDPOINT)\n authEndpoint: string | null = null,\n @Optional()\n @Inject(OAUTH_SECRET)\n secret: string | null = null,\n @Optional()\n @Inject(OAUTH_SSO_URL)\n ssoUrl: string | null = null,\n @Optional()\n @Inject(RXAP_O_AUTH_REDIRECT_SIGN_OUT)\n redirectSignOut: string[] | null = null,\n @Optional()\n @Inject(RXAP_O_AUTH_REDIRECT_URL)\n redirectUrl: string | null = null\n ) {\n super(oAuthMethod, getOAuthProfileMethod, router, profileEndpoint, authEndpoint, secret, ssoUrl, redirectSignOut, redirectUrl);\n }\n\n public async signInWithEmailAndPassword(\n email: string,\n password: string,\n remember: boolean\n ): Promise<OAuthMethodResponse> {\n const response = await super.signInWithEmailAndPassword(email, password, remember);\n this.redirectToClient();\n return response;\n }\n\n public redirectToClient() {\n window.location.replace(`${this.redirect}?accessToken=${this.accessToken}&refreshToken=${this.refreshToken}&expiresIn=${this.expiresIn}&payload=${this.payload}`);\n }\n\n public async signOut() {\n this.clearStorage();\n this.accessToken = null;\n this.refreshToken = null;\n this.expiresAt = null;\n this._isAuthenticated = false;\n }\n\n}\n"]}
@@ -1,33 +0,0 @@
1
- import { ContinueComponent } from './continue/continue.component';
2
- import { ProfileResolve, ContainerComponent, LoadingComponent } from '@rxap/oauth';
3
- import { OAuthSingleSignOnGuard } from './o-auth-single-sign-on.guard';
4
- import { ErrorComponent } from './error/error.component';
5
- export const RXAP_O_AUTH_SINGLE_SIGN_ON_ROUTES = [
6
- {
7
- path: '',
8
- component: ContainerComponent,
9
- children: [
10
- {
11
- path: 'continue',
12
- component: ContinueComponent,
13
- resolve: {
14
- profile: ProfileResolve
15
- }
16
- },
17
- {
18
- path: 'error',
19
- component: ErrorComponent
20
- },
21
- {
22
- path: '',
23
- canActivate: [OAuthSingleSignOnGuard],
24
- component: LoadingComponent
25
- },
26
- {
27
- path: '**',
28
- redirectTo: ''
29
- }
30
- ]
31
- }
32
- ];
33
- //# sourceMappingURL=routes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../../../../libs/oauth/single-sign-on/src/lib/routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,MAAM,CAAC,MAAM,iCAAiC,GAAW;IACvD;QACE,IAAI,EAAO,EAAE;QACb,SAAS,EAAE,kBAAkB;QAC7B,QAAQ,EAAG;YACT;gBACE,IAAI,EAAO,UAAU;gBACrB,SAAS,EAAE,iBAAiB;gBAC5B,OAAO,EAAI;oBACT,OAAO,EAAE,cAAc;iBACxB;aACF;YACD;gBACE,IAAI,EAAO,OAAO;gBAClB,SAAS,EAAE,cAAc;aAC1B;YACD;gBACE,IAAI,EAAS,EAAE;gBACf,WAAW,EAAE,CAAE,sBAAsB,CAAE;gBACvC,SAAS,EAAI,gBAAgB;aAC9B;YACD;gBACE,IAAI,EAAQ,IAAI;gBAChB,UAAU,EAAE,EAAE;aACf;SACF;KACF;CACF,CAAC","sourcesContent":["import { Routes } from '@angular/router';\nimport { ContinueComponent } from './continue/continue.component';\nimport {\n ProfileResolve,\n ContainerComponent,\n LoadingComponent\n} from '@rxap/oauth';\nimport { OAuthSingleSignOnGuard } from './o-auth-single-sign-on.guard';\nimport { ErrorComponent } from './error/error.component';\n\nexport const RXAP_O_AUTH_SINGLE_SIGN_ON_ROUTES: Routes = [\n {\n path: '',\n component: ContainerComponent,\n children: [\n {\n path: 'continue',\n component: ContinueComponent,\n resolve: {\n profile: ProfileResolve\n }\n },\n {\n path: 'error',\n component: ErrorComponent\n },\n {\n path: '',\n canActivate: [ OAuthSingleSignOnGuard ],\n component: LoadingComponent\n },\n {\n path: '**',\n redirectTo: ''\n }\n ]\n }\n];\n"]}
@@ -1,10 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- export function DefaultRedirectContinueFactory() {
3
- return ['/', 'continue'];
4
- }
5
- export const RXAP_O_AUTH_SINGLE_SIGN_ON_REDIRECT_CONTINUE = new InjectionToken('rxap/o-auth/single-sign-on/redirect-continue', {
6
- providedIn: 'root',
7
- factory: DefaultRedirectContinueFactory
8
- });
9
- export const RXAP_O_AUTH_SSO_REDIRECT_CONTINUE_DISABLED = new InjectionToken('rxap/o-auth/single-sign-on/redirect-continue-disabled');
10
- //# sourceMappingURL=tokens.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../../../libs/oauth/single-sign-on/src/lib/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,UAAU,8BAA8B;IAC5C,OAAO,CAAE,GAAG,EAAE,UAAU,CAAE,CAAC;AAC7B,CAAC;AAED,MAAM,CAAC,MAAM,4CAA4C,GAAG,IAAI,cAAc,CAAC,8CAA8C,EAAE;IAC7H,UAAU,EAAE,MAAM;IAClB,OAAO,EAAK,8BAA8B;CAC3C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0CAA0C,GAAG,IAAI,cAAc,CAAC,uDAAuD,CAAC,CAAC","sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport function DefaultRedirectContinueFactory(): string[] {\n return [ '/', 'continue' ];\n}\n\nexport const RXAP_O_AUTH_SINGLE_SIGN_ON_REDIRECT_CONTINUE = new InjectionToken('rxap/o-auth/single-sign-on/redirect-continue', {\n providedIn: 'root',\n factory: DefaultRedirectContinueFactory\n});\n\nexport const RXAP_O_AUTH_SSO_REDIRECT_CONTINUE_DISABLED = new InjectionToken('rxap/o-auth/single-sign-on/redirect-continue-disabled');\n"]}
@@ -1,10 +0,0 @@
1
- export * from './lib/continue/continue.component.module';
2
- export * from './lib/continue/continue.component';
3
- export * from './lib/o-auth-single-sign-on.guard';
4
- export * from './lib/o-auth-single-sign-on-routing.module';
5
- export * from './lib/o-auth-single-sign-on.service';
6
- export * from './lib/routes';
7
- export * from './lib/tokens';
8
- export * from './lib/error/error.component.module';
9
- export * from './lib/error/error.component';
10
- //# sourceMappingURL=public_api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"public_api.js","sourceRoot":"","sources":["../../../../../libs/oauth/single-sign-on/src/public_api.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC;AACzD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC","sourcesContent":["export * from './lib/continue/continue.component.module';\nexport * from './lib/continue/continue.component';\nexport * from './lib/o-auth-single-sign-on.guard';\nexport * from './lib/o-auth-single-sign-on-routing.module';\nexport * from './lib/o-auth-single-sign-on.service';\nexport * from './lib/routes';\nexport * from './lib/tokens';\nexport * from './lib/error/error.component.module';\nexport * from './lib/error/error.component';\n"]}
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public_api';
5
- //# sourceMappingURL=rxap-oauth-single-sign-on.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rxap-oauth-single-sign-on.js","sourceRoot":"","sources":["../../../../../libs/oauth/single-sign-on/src/rxap-oauth-single-sign-on.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,cAAc,CAAC","sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"]}
@@ -1,416 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, Inject, Optional, Component, ChangeDetectionStrategy, NgModule, InjectionToken } from '@angular/core';
3
- import { trigger, state, style, transition, animate } from '@angular/animations';
4
- import * as i5 from '@angular/router';
5
- import { Router, ActivatedRoute } from '@angular/router';
6
- import { take, map } from 'rxjs/operators';
7
- import { __awaiter } from 'tslib';
8
- import * as i1 from '@rxap/oauth';
9
- import { OAuthService, OAuthMethod, GetOAuthProfileMethod, PROFILE_AUTH_ENDPOINT, OAUTH_AUTH_ENDPOINT, OAUTH_SECRET, OAUTH_SSO_URL, RXAP_O_AUTH_REDIRECT_SIGN_OUT, RXAP_O_AUTH_REDIRECT_URL, RXAP_O_AUTH_REDIRECT_SIGN_IN, LoadingComponentModule, ContainerComponentModule, ContainerComponent, ProfileResolve, LoadingComponent } from '@rxap/oauth';
10
- import * as i1$1 from '@angular/material/button';
11
- import { MatButtonModule } from '@angular/material/button';
12
- import * as i2 from '@angular/flex-layout/flex';
13
- import * as i3 from '@angular/common';
14
- import { CommonModule } from '@angular/common';
15
- import * as i4 from '@rxap/directives';
16
- import { AvatarBackgroundImageDirectiveModule } from '@rxap/directives';
17
- import { FlexLayoutModule } from '@angular/flex-layout';
18
- import { MatIconModule } from '@angular/material/icon';
19
-
20
- class OAuthSingleSignOnService extends OAuthService {
21
- // It is required to define the constructor with the injection
22
- // definition. If not defined the constructor will be created by
23
- // typescript without an parameters, bc the payload and redirect
24
- // initialization is done in the constructor.
25
- constructor(oAuthMethod, getOAuthProfileMethod, router, profileEndpoint = null, authEndpoint = null, secret = null, ssoUrl = null, redirectSignOut = null, redirectUrl = null) {
26
- super(oAuthMethod, getOAuthProfileMethod, router, profileEndpoint, authEndpoint, secret, ssoUrl, redirectSignOut, redirectUrl);
27
- this.payload = null;
28
- this.redirect = null;
29
- }
30
- signInWithEmailAndPassword(email, password, remember) {
31
- const _super = Object.create(null, {
32
- signInWithEmailAndPassword: { get: () => super.signInWithEmailAndPassword }
33
- });
34
- return __awaiter(this, void 0, void 0, function* () {
35
- const response = yield _super.signInWithEmailAndPassword.call(this, email, password, remember);
36
- this.redirectToClient();
37
- return response;
38
- });
39
- }
40
- redirectToClient() {
41
- window.location.replace(`${this.redirect}?accessToken=${this.accessToken}&refreshToken=${this.refreshToken}&expiresIn=${this.expiresIn}&payload=${this.payload}`);
42
- }
43
- signOut() {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- this.clearStorage();
46
- this.accessToken = null;
47
- this.refreshToken = null;
48
- this.expiresAt = null;
49
- this._isAuthenticated = false;
50
- });
51
- }
52
- }
53
- OAuthSingleSignOnService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OAuthSingleSignOnService, deps: [{ token: OAuthMethod }, { token: GetOAuthProfileMethod }, { token: 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 }], target: i0.ɵɵFactoryTarget.Injectable });
54
- OAuthSingleSignOnService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OAuthSingleSignOnService });
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OAuthSingleSignOnService, decorators: [{
56
- type: Injectable
57
- }], ctorParameters: function () { return [{ type: i1.OAuthMethod, decorators: [{
58
- type: Inject,
59
- args: [OAuthMethod]
60
- }] }, { type: i1.GetOAuthProfileMethod, decorators: [{
61
- type: Inject,
62
- args: [GetOAuthProfileMethod]
63
- }] }, { type: i5.Router, decorators: [{
64
- type: Inject,
65
- args: [Router]
66
- }] }, { type: undefined, decorators: [{
67
- type: Optional
68
- }, {
69
- type: Inject,
70
- args: [PROFILE_AUTH_ENDPOINT]
71
- }] }, { type: undefined, decorators: [{
72
- type: Optional
73
- }, {
74
- type: Inject,
75
- args: [OAUTH_AUTH_ENDPOINT]
76
- }] }, { type: undefined, decorators: [{
77
- type: Optional
78
- }, {
79
- type: Inject,
80
- args: [OAUTH_SECRET]
81
- }] }, { type: undefined, decorators: [{
82
- type: Optional
83
- }, {
84
- type: Inject,
85
- args: [OAUTH_SSO_URL]
86
- }] }, { type: undefined, decorators: [{
87
- type: Optional
88
- }, {
89
- type: Inject,
90
- args: [RXAP_O_AUTH_REDIRECT_SIGN_OUT]
91
- }] }, { type: undefined, decorators: [{
92
- type: Optional
93
- }, {
94
- type: Inject,
95
- args: [RXAP_O_AUTH_REDIRECT_URL]
96
- }] }]; } });
97
-
98
- class ContinueComponent {
99
- constructor(route, router, oAuthService, redirectLogin) {
100
- this.route = route;
101
- this.router = router;
102
- this.oAuthService = oAuthService;
103
- this.redirectLogin = redirectLogin;
104
- }
105
- ngOnInit() {
106
- this.profile = this.route.data
107
- .pipe(take(1), map((data) => data.profile))
108
- .toPromise();
109
- }
110
- signOut() {
111
- this.oAuthService.signOut();
112
- return this.router.navigate(this.redirectLogin);
113
- }
114
- redirect() {
115
- this.oAuthService.redirectToClient();
116
- }
117
- }
118
- ContinueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContinueComponent, deps: [{ token: ActivatedRoute }, { token: Router }, { token: OAuthService }, { token: RXAP_O_AUTH_REDIRECT_SIGN_IN }], target: i0.ɵɵFactoryTarget.Component });
119
- ContinueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContinueComponent, selector: "rxap-continue", host: { classAttribute: "rxap-continue" }, ngImport: i0, template: "<div [@fadeAnimation]=\"'in'\" class=\"inner mat-elevation-z5\" fxLayout=\"column\" fxLayoutAlign=\"center center\"\n fxLayoutGap=\"32px\">\n\n <div class=\"header\" fxFlex=\"nogrow\" fxLayout=\"column\" fxLayoutAlign=\"center center\">\n\n <div *ngIf=\"profile | async as p\" [name]=\"p.username\" [rxapAvatarBackgroundImage]=\"p.username\"\n class=\"avatar-icon\"></div>\n\n </div>\n\n <div class=\"content\" fxLayout=\"column\" fxLayoutGap=\"32px\">\n\n <div fxLayout=\"column\">\n\n <p><span i18n>Currently Sign In as:</span> <span class=\"username\"><br>{{(profile | async)?.username}}</span></p>\n\n </div>\n\n <div fxFlex=\"nogrow\" fxLayout=\"column\" fxLayoutAlign=\"center center\" fxLayoutGap=\"8px\">\n\n <div fxFlex=\"nogrow\">\n <button (click)=\"redirect()\" color=\"primary\" i18n mat-raised-button>Continue</button>\n </div>\n\n <div fxFlex=\"nogrow\">\n <button (click)=\"signOut()\" color=\"accent\" i18n mat-stroked-button>Change Account</button>\n </div>\n\n </div>\n\n </div>\n\n</div>\n", styles: [".inner{padding:64px;position:relative}.inner .header .avatar-icon{width:100px;height:100px;font-size:100px;border-radius:100%}.inner .content .email-input,.inner .content .password-input{width:320px}.inner .content .email-input .prefix-icon,.inner .content .password-input .prefix-icon{width:24px;height:24px;display:flex;justify-content:center;align-items:center}.inner .content .email-input ::ng-deep .mat-form-field-prefix,.inner .content .password-input ::ng-deep .mat-form-field-prefix{align-self:flex-end;margin:4px}.inner .content [type=submit]{width:128px;text-transform:uppercase}.inner .loading-bar{position:absolute;bottom:0;left:0;right:0;top:auto}"], components: [{ type: i1$1.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: i2.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: i2.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: i2.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: i2.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"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.AvatarBackgroundImageDirective, selector: "[rxapAvatarBackgroundImage]", inputs: ["name", "rxapAvatarBackgroundImage"] }], pipes: { "async": i3.AsyncPipe }, animations: [
120
- trigger('fadeAnimation', [
121
- // the "in" style determines the "resting" state of the element when it is visible.
122
- state('in', style({ opacity: 1 })),
123
- // fade in when created. this could also be written as transition('void => *')
124
- transition(':enter', [style({ opacity: 0 }), animate(300)]),
125
- // fade out when destroyed. this could also be written as transition('void => *')
126
- transition(':leave', animate(300, style({ opacity: 0 }))),
127
- ]),
128
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
129
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContinueComponent, decorators: [{
130
- type: Component,
131
- args: [{
132
- selector: 'rxap-continue',
133
- templateUrl: './continue.component.html',
134
- styleUrls: ['./continue.component.scss'],
135
- changeDetection: ChangeDetectionStrategy.OnPush,
136
- host: { class: 'rxap-continue' },
137
- animations: [
138
- trigger('fadeAnimation', [
139
- // the "in" style determines the "resting" state of the element when it is visible.
140
- state('in', style({ opacity: 1 })),
141
- // fade in when created. this could also be written as transition('void => *')
142
- transition(':enter', [style({ opacity: 0 }), animate(300)]),
143
- // fade out when destroyed. this could also be written as transition('void => *')
144
- transition(':leave', animate(300, style({ opacity: 0 }))),
145
- ]),
146
- ],
147
- }]
148
- }], ctorParameters: function () { return [{ type: i5.ActivatedRoute, decorators: [{
149
- type: Inject,
150
- args: [ActivatedRoute]
151
- }] }, { type: i5.Router, decorators: [{
152
- type: Inject,
153
- args: [Router]
154
- }] }, { type: OAuthSingleSignOnService, decorators: [{
155
- type: Inject,
156
- args: [OAuthService]
157
- }] }, { type: undefined, decorators: [{
158
- type: Inject,
159
- args: [RXAP_O_AUTH_REDIRECT_SIGN_IN]
160
- }] }]; } });
161
-
162
- class ContinueComponentModule {
163
- }
164
- ContinueComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContinueComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
165
- ContinueComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContinueComponentModule, declarations: [ContinueComponent], imports: [FlexLayoutModule,
166
- MatIconModule,
167
- MatButtonModule,
168
- CommonModule,
169
- AvatarBackgroundImageDirectiveModule], exports: [ContinueComponent] });
170
- ContinueComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContinueComponentModule, imports: [[
171
- FlexLayoutModule,
172
- MatIconModule,
173
- MatButtonModule,
174
- CommonModule,
175
- AvatarBackgroundImageDirectiveModule
176
- ]] });
177
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContinueComponentModule, decorators: [{
178
- type: NgModule,
179
- args: [{
180
- declarations: [
181
- ContinueComponent
182
- ],
183
- imports: [
184
- FlexLayoutModule,
185
- MatIconModule,
186
- MatButtonModule,
187
- CommonModule,
188
- AvatarBackgroundImageDirectiveModule
189
- ],
190
- exports: [
191
- ContinueComponent
192
- ]
193
- }]
194
- }] });
195
-
196
- function DefaultRedirectContinueFactory() {
197
- return ['/', 'continue'];
198
- }
199
- const RXAP_O_AUTH_SINGLE_SIGN_ON_REDIRECT_CONTINUE = new InjectionToken('rxap/o-auth/single-sign-on/redirect-continue', {
200
- providedIn: 'root',
201
- factory: DefaultRedirectContinueFactory
202
- });
203
- const RXAP_O_AUTH_SSO_REDIRECT_CONTINUE_DISABLED = new InjectionToken('rxap/o-auth/single-sign-on/redirect-continue-disabled');
204
-
205
- class OAuthSingleSignOnGuard {
206
- constructor(authentication, router, redirectContinue, redirectLogin, redirectContinueDisabled) {
207
- this.authentication = authentication;
208
- this.router = router;
209
- this.redirectContinue = redirectContinue;
210
- this.redirectLogin = redirectLogin;
211
- this.redirectContinueDisabled = redirectContinueDisabled;
212
- }
213
- canActivate(route) {
214
- return __awaiter(this, void 0, void 0, function* () {
215
- const redirect = route.queryParamMap.get('redirect');
216
- const secret = route.queryParamMap.get('secret');
217
- const payload = route.queryParamMap.get('payload');
218
- const action = route.queryParamMap.get('action');
219
- if (!redirect || !secret) {
220
- console.warn(`The query params 'redirect' or 'secret' is not defined!`);
221
- return this.router.createUrlTree(['error']);
222
- }
223
- this.authentication.redirect = atob(redirect);
224
- this.authentication.payload = payload;
225
- this.authentication.secret = secret;
226
- if (action) {
227
- if (action === 'signOut') {
228
- yield this.authentication.signOut();
229
- return this.router.createUrlTree(this.redirectLogin);
230
- }
231
- }
232
- const isAuthenticated = yield this.authentication.isAuthenticated();
233
- console.log('isAuthenticated', isAuthenticated);
234
- if (isAuthenticated) {
235
- if (this.redirectContinueDisabled) {
236
- this.authentication.redirectToClient();
237
- return true;
238
- }
239
- return this.router.createUrlTree(this.redirectContinue);
240
- }
241
- return this.router.createUrlTree(this.redirectLogin);
242
- });
243
- }
244
- }
245
- OAuthSingleSignOnGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OAuthSingleSignOnGuard, deps: [{ token: OAuthService }, { token: Router }, { token: RXAP_O_AUTH_SINGLE_SIGN_ON_REDIRECT_CONTINUE }, { token: RXAP_O_AUTH_REDIRECT_SIGN_IN }, { token: RXAP_O_AUTH_SSO_REDIRECT_CONTINUE_DISABLED, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
246
- OAuthSingleSignOnGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OAuthSingleSignOnGuard });
247
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OAuthSingleSignOnGuard, decorators: [{
248
- type: Injectable
249
- }], ctorParameters: function () { return [{ type: OAuthSingleSignOnService, decorators: [{
250
- type: Inject,
251
- args: [OAuthService]
252
- }] }, { type: i5.Router, decorators: [{
253
- type: Inject,
254
- args: [Router]
255
- }] }, { type: undefined, decorators: [{
256
- type: Inject,
257
- args: [RXAP_O_AUTH_SINGLE_SIGN_ON_REDIRECT_CONTINUE]
258
- }] }, { type: undefined, decorators: [{
259
- type: Inject,
260
- args: [RXAP_O_AUTH_REDIRECT_SIGN_IN]
261
- }] }, { type: undefined, decorators: [{
262
- type: Optional
263
- }, {
264
- type: Inject,
265
- args: [RXAP_O_AUTH_SSO_REDIRECT_CONTINUE_DISABLED]
266
- }] }]; } });
267
-
268
- class ErrorComponent {
269
- get topLevelDomain() {
270
- const match = location.hostname.match(/([^.]+\.[^.]+$)/);
271
- if (match) {
272
- return match[0];
273
- }
274
- else {
275
- return location.hostname;
276
- }
277
- }
278
- get mainApplicationUrl() {
279
- return `${location.protocol}//${this.topLevelDomain}`;
280
- }
281
- }
282
- ErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
283
- ErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ErrorComponent, selector: "rxap-error", host: { classAttribute: "rxap-error" }, ngImport: i0, template: "<div [@fadeAnimation]=\"'in'\" class=\"inner mat-elevation-z5\" fxLayout=\"column\" fxLayoutAlign=\"center center\"\n fxLayoutGap=\"32px\">\n\n <div class=\"content\" fxLayout=\"column\" fxLayoutGap=\"32px\">\n\n <div fxLayout=\"column\" fxLayoutGap=\"8px\">\n\n <h2 i18n=\"@@rxap-oauth.single-sign-on.error.title\">Error</h2>\n <p i18n=\"@@rxap-oauth.single-sign-on.error.message\">Please open the main application again.</p>\n <a [href]=\"mainApplicationUrl\" color=\"primary\" mat-raised-button>\n <ng-container i18n=\"@@rxap-oauth.single-sign-on.error.action\">Navigate to main application</ng-container>\n </a>\n\n </div>\n\n </div>\n\n</div>\n", styles: [".inner{padding:64px;position:relative}"], components: [{ type: i1$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }], directives: [{ type: i2.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: i2.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: i2.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"] }], animations: [
284
- trigger('fadeAnimation', [
285
- // the "in" style determines the "resting" state of the element when it is visible.
286
- state('in', style({ opacity: 1 })),
287
- // fade in when created. this could also be written as transition('void => *')
288
- transition(':enter', [style({ opacity: 0 }), animate(300)]),
289
- // fade out when destroyed. this could also be written as transition('void => *')
290
- transition(':leave', animate(300, style({ opacity: 0 })))
291
- ])
292
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
293
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ErrorComponent, decorators: [{
294
- type: Component,
295
- args: [{
296
- selector: 'rxap-error',
297
- templateUrl: './error.component.html',
298
- styleUrls: ['./error.component.scss'],
299
- changeDetection: ChangeDetectionStrategy.OnPush,
300
- host: { class: 'rxap-error' },
301
- animations: [
302
- trigger('fadeAnimation', [
303
- // the "in" style determines the "resting" state of the element when it is visible.
304
- state('in', style({ opacity: 1 })),
305
- // fade in when created. this could also be written as transition('void => *')
306
- transition(':enter', [style({ opacity: 0 }), animate(300)]),
307
- // fade out when destroyed. this could also be written as transition('void => *')
308
- transition(':leave', animate(300, style({ opacity: 0 })))
309
- ])
310
- ]
311
- }]
312
- }] });
313
-
314
- class ErrorComponentModule {
315
- }
316
- ErrorComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ErrorComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
317
- ErrorComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ErrorComponentModule, declarations: [ErrorComponent], imports: [FlexLayoutModule,
318
- MatButtonModule], exports: [ErrorComponent] });
319
- ErrorComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ErrorComponentModule, imports: [[
320
- FlexLayoutModule,
321
- MatButtonModule
322
- ]] });
323
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ErrorComponentModule, decorators: [{
324
- type: NgModule,
325
- args: [{
326
- declarations: [
327
- ErrorComponent
328
- ],
329
- imports: [
330
- FlexLayoutModule,
331
- MatButtonModule
332
- ],
333
- exports: [
334
- ErrorComponent
335
- ]
336
- }]
337
- }] });
338
-
339
- class OAuthSingleSignOnRoutingModule {
340
- static forRouting(options = {}) {
341
- const providers = [
342
- OAuthSingleSignOnGuard
343
- ];
344
- if (options.redirectContinueDisabled) {
345
- providers.push({
346
- provide: RXAP_O_AUTH_SSO_REDIRECT_CONTINUE_DISABLED,
347
- useValue: options.redirectContinueDisabled
348
- });
349
- }
350
- return {
351
- ngModule: OAuthSingleSignOnRoutingModule,
352
- providers
353
- };
354
- }
355
- }
356
- OAuthSingleSignOnRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OAuthSingleSignOnRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
357
- OAuthSingleSignOnRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OAuthSingleSignOnRoutingModule, exports: [ContinueComponentModule,
358
- LoadingComponentModule,
359
- ContainerComponentModule,
360
- ErrorComponentModule] });
361
- OAuthSingleSignOnRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OAuthSingleSignOnRoutingModule, providers: [
362
- OAuthSingleSignOnGuard
363
- ], imports: [ContinueComponentModule,
364
- LoadingComponentModule,
365
- ContainerComponentModule,
366
- ErrorComponentModule] });
367
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OAuthSingleSignOnRoutingModule, decorators: [{
368
- type: NgModule,
369
- args: [{
370
- exports: [
371
- ContinueComponentModule,
372
- LoadingComponentModule,
373
- ContainerComponentModule,
374
- ErrorComponentModule
375
- ],
376
- providers: [
377
- OAuthSingleSignOnGuard
378
- ]
379
- }]
380
- }] });
381
-
382
- const RXAP_O_AUTH_SINGLE_SIGN_ON_ROUTES = [
383
- {
384
- path: '',
385
- component: ContainerComponent,
386
- children: [
387
- {
388
- path: 'continue',
389
- component: ContinueComponent,
390
- resolve: {
391
- profile: ProfileResolve
392
- }
393
- },
394
- {
395
- path: 'error',
396
- component: ErrorComponent
397
- },
398
- {
399
- path: '',
400
- canActivate: [OAuthSingleSignOnGuard],
401
- component: LoadingComponent
402
- },
403
- {
404
- path: '**',
405
- redirectTo: ''
406
- }
407
- ]
408
- }
409
- ];
410
-
411
- /**
412
- * Generated bundle index. Do not edit.
413
- */
414
-
415
- export { ContinueComponent, ContinueComponentModule, DefaultRedirectContinueFactory, ErrorComponent, ErrorComponentModule, OAuthSingleSignOnGuard, OAuthSingleSignOnRoutingModule, OAuthSingleSignOnService, RXAP_O_AUTH_SINGLE_SIGN_ON_REDIRECT_CONTINUE, RXAP_O_AUTH_SINGLE_SIGN_ON_ROUTES, RXAP_O_AUTH_SSO_REDIRECT_CONTINUE_DISABLED };
416
- //# sourceMappingURL=rxap-oauth-single-sign-on.js.map