@rxap/ngx-oauth2-proxy 18.0.0 → 18.0.1-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [18.0.1-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/ngx-oauth2-proxy@18.0.0...@rxap/ngx-oauth2-proxy@18.0.1-dev.0) (2024-07-09)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- use static pub sub topics ([780d3f9](https://gitlab.com/rxap/packages/commit/780d3f9aae3b272713ad9946e7938f1f13dd91a4))
|
|
11
|
+
|
|
6
12
|
# [18.0.0](https://gitlab.com/rxap/packages/compare/@rxap/ngx-oauth2-proxy@18.0.0-dev.1...@rxap/ngx-oauth2-proxy@18.0.0) (2024-06-30)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @rxap/ngx-oauth2-proxy
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { APP_INITIALIZER } from '@angular/core';
|
|
2
|
-
import { PubSubService } from '@rxap/ngx-pub-sub';
|
|
2
|
+
import { PubSubService, RXAP_TOPICS, } from '@rxap/ngx-pub-sub';
|
|
3
3
|
export function subscribeToLogoutEvent(pubSubService) {
|
|
4
4
|
return () => {
|
|
5
|
-
pubSubService.subscribe(
|
|
5
|
+
pubSubService.subscribe(RXAP_TOPICS.authentication.logout).subscribe(() => {
|
|
6
6
|
location.replace(location.origin + '/oauth2/sign_out');
|
|
7
7
|
});
|
|
8
8
|
};
|
|
@@ -15,4 +15,4 @@ export function provideOauth2Proxy() {
|
|
|
15
15
|
multi: true,
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
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Uyxcbn0gZnJvbSAnQHJ4YXAvbmd4LXB1Yi1zdWInO1xuXG5leHBvcnQgZnVuY3Rpb24gc3Vic2NyaWJlVG9Mb2dvdXRFdmVudChwdWJTdWJTZXJ2aWNlOiBQdWJTdWJTZXJ2aWNlKSB7XG4gIHJldHVybiAoKSA9PiB7XG4gICAgcHViU3ViU2VydmljZS5zdWJzY3JpYmUoUlhBUF9UT1BJQ1MuYXV0aGVudGljYXRpb24ubG9nb3V0KS5zdWJzY3JpYmUoKCkgPT4ge1xuICAgICAgbG9jYXRpb24ucmVwbGFjZShsb2NhdGlvbi5vcmlnaW4gKyAnL29hdXRoMi9zaWduX291dCcpO1xuICAgIH0pO1xuICB9O1xufVxuXG5leHBvcnQgZnVuY3Rpb24gcHJvdmlkZU9hdXRoMlByb3h5KCkge1xuICByZXR1cm4ge1xuICAgIHByb3ZpZGU6IEFQUF9JTklUSUFMSVpFUixcbiAgICB1c2VGYWN0b3J5OiBzdWJzY3JpYmVUb0xvZ291dEV2ZW50LFxuICAgIGRlcHM6IFsgUHViU3ViU2VydmljZSBdLFxuICAgIG11bHRpOiB0cnVlLFxuICB9O1xufVxuIl19
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
|
|
2
2
|
import { inject, APP_INITIALIZER } from '@angular/core';
|
|
3
3
|
import { firstValueFrom, map, catchError, of } from 'rxjs';
|
|
4
|
-
import { PubSubService } from '@rxap/ngx-pub-sub';
|
|
4
|
+
import { RXAP_TOPICS, PubSubService } from '@rxap/ngx-pub-sub';
|
|
5
5
|
|
|
6
6
|
const oauth2ProxyGuard = async () => {
|
|
7
7
|
const http = inject(HttpClient);
|
|
@@ -21,7 +21,7 @@ const oauth2ProxyGuard = async () => {
|
|
|
21
21
|
|
|
22
22
|
function subscribeToLogoutEvent(pubSubService) {
|
|
23
23
|
return () => {
|
|
24
|
-
pubSubService.subscribe(
|
|
24
|
+
pubSubService.subscribe(RXAP_TOPICS.authentication.logout).subscribe(() => {
|
|
25
25
|
location.replace(location.origin + '/oauth2/sign_out');
|
|
26
26
|
});
|
|
27
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxap-ngx-oauth2-proxy.mjs","sources":["../../../../../packages/angular/oauth2-proxy/src/lib/oauth2-proxy.guard.ts","../../../../../packages/angular/oauth2-proxy/src/lib/provide-oauth2-proxy.ts","../../../../../packages/angular/oauth2-proxy/src/index.ts","../../../../../packages/angular/oauth2-proxy/src/rxap-ngx-oauth2-proxy.ts"],"sourcesContent":["import {\n HttpClient,\n HttpErrorResponse,\n} from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { CanActivateFn } from '@angular/router';\nimport {\n catchError,\n firstValueFrom,\n map,\n of,\n} from 'rxjs';\n\nexport const oauth2ProxyGuard: CanActivateFn = async () => {\n\n const http = inject(HttpClient);\n\n const isAuthenticated = await firstValueFrom(http.get('/oauth2/auth').pipe(\n map(() => true),\n catchError(error => {\n if (error instanceof HttpErrorResponse) {\n if (error.status === 401) {\n return of(false);\n }\n }\n throw error;\n }),\n ));\n\n if (!isAuthenticated) {\n location.replace(location.origin + '/oauth2/sign_in');\n }\n\n return isAuthenticated;\n\n};\n","import { APP_INITIALIZER } from '@angular/core';\nimport {
|
|
1
|
+
{"version":3,"file":"rxap-ngx-oauth2-proxy.mjs","sources":["../../../../../packages/angular/oauth2-proxy/src/lib/oauth2-proxy.guard.ts","../../../../../packages/angular/oauth2-proxy/src/lib/provide-oauth2-proxy.ts","../../../../../packages/angular/oauth2-proxy/src/index.ts","../../../../../packages/angular/oauth2-proxy/src/rxap-ngx-oauth2-proxy.ts"],"sourcesContent":["import {\n HttpClient,\n HttpErrorResponse,\n} from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { CanActivateFn } from '@angular/router';\nimport {\n catchError,\n firstValueFrom,\n map,\n of,\n} from 'rxjs';\n\nexport const oauth2ProxyGuard: CanActivateFn = async () => {\n\n const http = inject(HttpClient);\n\n const isAuthenticated = await firstValueFrom(http.get('/oauth2/auth').pipe(\n map(() => true),\n catchError(error => {\n if (error instanceof HttpErrorResponse) {\n if (error.status === 401) {\n return of(false);\n }\n }\n throw error;\n }),\n ));\n\n if (!isAuthenticated) {\n location.replace(location.origin + '/oauth2/sign_in');\n }\n\n return isAuthenticated;\n\n};\n","import { APP_INITIALIZER } from '@angular/core';\nimport {\n PubSubService,\n RXAP_TOPICS,\n} from '@rxap/ngx-pub-sub';\n\nexport function subscribeToLogoutEvent(pubSubService: PubSubService) {\n return () => {\n pubSubService.subscribe(RXAP_TOPICS.authentication.logout).subscribe(() => {\n location.replace(location.origin + '/oauth2/sign_out');\n });\n };\n}\n\nexport function provideOauth2Proxy() {\n return {\n provide: APP_INITIALIZER,\n useFactory: subscribeToLogoutEvent,\n deps: [ PubSubService ],\n multi: true,\n };\n}\n","// region \nexport * from './lib/oauth2-proxy.guard';\nexport * from './lib/provide-oauth2-proxy';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAaa,MAAA,gBAAgB,GAAkB,YAAW;AAExD,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IAEhC,MAAM,eAAe,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,IAAI,CACxE,GAAG,CAAC,MAAM,IAAI,CAAC,EACf,UAAU,CAAC,KAAK,IAAG;AACjB,QAAA,IAAI,KAAK,YAAY,iBAAiB,EAAE;AACtC,YAAA,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,EAAE;AACxB,gBAAA,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;aAClB;SACF;AACD,QAAA,MAAM,KAAK,CAAC;KACb,CAAC,CACH,CAAC,CAAC;IAEH,IAAI,CAAC,eAAe,EAAE;QACpB,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC;KACvD;AAED,IAAA,OAAO,eAAe,CAAC;AAEzB;;AC7BM,SAAU,sBAAsB,CAAC,aAA4B,EAAA;AACjE,IAAA,OAAO,MAAK;AACV,QAAA,aAAa,CAAC,SAAS,CAAC,WAAW,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,MAAK;YACxE,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,kBAAkB,CAAC,CAAC;AACzD,SAAC,CAAC,CAAC;AACL,KAAC,CAAC;AACJ,CAAC;SAEe,kBAAkB,GAAA;IAChC,OAAO;AACL,QAAA,OAAO,EAAE,eAAe;AACxB,QAAA,UAAU,EAAE,sBAAsB;QAClC,IAAI,EAAE,CAAE,aAAa,CAAE;AACvB,QAAA,KAAK,EAAE,IAAI;KACZ,CAAC;AACJ;;ACrBA;AAGA;;ACHA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "18.0.0",
|
|
2
|
+
"version": "18.0.1-dev.0",
|
|
3
3
|
"name": "@rxap/ngx-oauth2-proxy",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@nx/devkit": "19.
|
|
6
|
+
"@nx/devkit": "19.4.2",
|
|
7
7
|
"tslib": "2.6.2"
|
|
8
8
|
},
|
|
9
9
|
"peerDependencies": {
|
|
10
|
-
"@angular/common": "^18.0.
|
|
11
|
-
"@angular/core": "^18.0.
|
|
12
|
-
"@angular/router": "^18.0.
|
|
13
|
-
"@rxap/ngx-pub-sub": "^18.0
|
|
10
|
+
"@angular/common": "^18.0.6",
|
|
11
|
+
"@angular/core": "^18.0.6",
|
|
12
|
+
"@angular/router": "^18.0.6",
|
|
13
|
+
"@rxap/ngx-pub-sub": "^18.1.0-dev.0",
|
|
14
14
|
"rxjs": "^7.8.1"
|
|
15
15
|
},
|
|
16
16
|
"author": {
|
|
@@ -34,23 +34,23 @@
|
|
|
34
34
|
"packageGroup": [
|
|
35
35
|
{
|
|
36
36
|
"package": "@angular/common",
|
|
37
|
-
"version": "18.0.
|
|
37
|
+
"version": "18.0.6"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"package": "@angular/core",
|
|
41
|
-
"version": "18.0.
|
|
41
|
+
"version": "18.0.6"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
"package": "@angular/platform-browser",
|
|
45
|
-
"version": "18.0.
|
|
45
|
+
"version": "18.0.6"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"package": "@angular/router",
|
|
49
|
-
"version": "18.0.
|
|
49
|
+
"version": "18.0.6"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
"package": "@rxap/ngx-pub-sub",
|
|
53
|
-
"version": "18.0
|
|
53
|
+
"version": "18.1.0-dev.0"
|
|
54
54
|
}
|
|
55
55
|
]
|
|
56
56
|
},
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"directory": "packages/angular/oauth2-proxy"
|
|
65
65
|
},
|
|
66
66
|
"sideEffects": false,
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "31fdf513912a70c112035d9c825cf5b072924d81",
|
|
68
68
|
"module": "fesm2022/rxap-ngx-oauth2-proxy.mjs",
|
|
69
69
|
"typings": "index.d.ts",
|
|
70
70
|
"exports": {
|