@rxap/authentication 16.0.0-dev.14 → 16.0.0-dev.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +1 -1
- package/esm2022/index.mjs +6 -5
- package/esm2022/lib/authentication.service.mjs +5 -55
- package/esm2022/lib/bearer-token.interceptor.mjs +27 -0
- package/esm2022/lib/tokens.mjs +6 -1
- package/fesm2022/rxap-authentication.mjs +77 -145
- package/fesm2022/rxap-authentication.mjs.map +1 -1
- package/index.d.ts +3 -4
- package/lib/authentication.service.d.ts +3 -10
- package/lib/bearer-token.interceptor.d.ts +3 -0
- package/lib/tokens.d.ts +6 -0
- package/package.json +6 -21
- package/theme.css +1 -1
- package/components/index.d.ts +0 -8
- package/components/lib/authentication-container/authentication-container.component.d.ts +0 -7
- package/components/lib/fade-animation.d.ts +0 -1
- package/components/lib/loading/loading.component.d.ts +0 -15
- package/components/lib/login/login.component.d.ts +0 -13
- package/components/lib/login/login.form.d.ts +0 -43
- package/components/lib/reset-password/reset-password.component.d.ts +0 -5
- package/components/lib/reset-password/reset-password.form.d.ts +0 -35
- package/components/lib/routes.d.ts +0 -2
- package/esm2022/components/index.mjs +0 -9
- package/esm2022/components/lib/authentication-container/authentication-container.component.mjs +0 -38
- package/esm2022/components/lib/fade-animation.mjs +0 -14
- package/esm2022/components/lib/loading/loading.component.mjs +0 -39
- package/esm2022/components/lib/login/login.component.mjs +0 -104
- package/esm2022/components/lib/login/login.form.mjs +0 -108
- package/esm2022/components/lib/reset-password/reset-password.component.mjs +0 -53
- package/esm2022/components/lib/reset-password/reset-password.form.mjs +0 -117
- package/esm2022/components/lib/routes.mjs +0 -32
- package/esm2022/components/rxap-authentication-components.mjs +0 -5
- package/esm2022/lib/user-profile.service.mjs +0 -38
- package/esm2022/lib/user.service.mjs +0 -16
- package/fesm2022/rxap-authentication-components.mjs +0 -453
- package/fesm2022/rxap-authentication-components.mjs.map +0 -1
- package/lib/user-profile.service.d.ts +0 -21
- package/lib/user.service.d.ts +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
# [16.0.0-dev.16](https://gitlab.com/rxap/packages/compare/@rxap/authentication@16.0.0-dev.15...@rxap/authentication@16.0.0-dev.16) (2023-09-27)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @rxap/authentication
|
|
9
|
+
|
|
10
|
+
# [16.0.0-dev.15](https://gitlab.com/rxap/packages/compare/@rxap/authentication@16.0.0-dev.14...@rxap/authentication@16.0.0-dev.15) (2023-09-19)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- remove unused services ([42e11d6](https://gitlab.com/rxap/packages/commit/42e11d6423a0a26c9074183fb2948441ef78bff2))
|
|
15
|
+
- support oauth ([a5c1d0d](https://gitlab.com/rxap/packages/commit/a5c1d0d32a6e874c5ad505e46c6803f451664585))
|
|
16
|
+
|
|
6
17
|
# [16.0.0-dev.14](https://gitlab.com/rxap/packages/compare/@rxap/authentication@16.0.0-dev.13...@rxap/authentication@16.0.0-dev.14) (2023-09-12)
|
|
7
18
|
|
|
8
19
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -18,5 +18,5 @@ yarn add @rxap/authentication
|
|
|
18
18
|
```
|
|
19
19
|
**Install peer dependencies:**
|
|
20
20
|
```bash
|
|
21
|
-
yarn add @angular/
|
|
21
|
+
yarn add @angular/common@^16.1.4 @angular/core@^16.1.4 @angular/router@^16.1.4 rxjs@^7.8.0 tslib@2.6.2
|
|
22
22
|
```
|
package/esm2022/index.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
// region
|
|
2
|
+
export * from './lib/authentication-routing.service';
|
|
1
3
|
export * from './lib/authentication.guard';
|
|
2
4
|
export * from './lib/authentication.service';
|
|
5
|
+
export * from './lib/bearer-token.interceptor';
|
|
3
6
|
export * from './lib/register.service';
|
|
4
|
-
export * from './lib/user.service';
|
|
5
|
-
export * from './lib/authentication-routing.service';
|
|
6
|
-
export * from './lib/tokens';
|
|
7
7
|
export * from './lib/sign-out.directive';
|
|
8
|
-
export * from './lib/
|
|
9
|
-
|
|
8
|
+
export * from './lib/tokens';
|
|
9
|
+
// endregion
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hbmd1bGFyL2F1dGhlbnRpY2F0aW9uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxVQUFVO0FBQ1YsY0FBYyxzQ0FBc0MsQ0FBQztBQUNyRCxjQUFjLDRCQUE0QixDQUFDO0FBQzNDLGNBQWMsOEJBQThCLENBQUM7QUFDN0MsY0FBYyxnQ0FBZ0MsQ0FBQztBQUMvQyxjQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYyxjQUFjLENBQUM7QUFDN0IsWUFBWSIsInNvdXJjZXNDb250ZW50IjpbIi8vIHJlZ2lvbiBcbmV4cG9ydCAqIGZyb20gJy4vbGliL2F1dGhlbnRpY2F0aW9uLXJvdXRpbmcuc2VydmljZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9hdXRoZW50aWNhdGlvbi5ndWFyZCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9hdXRoZW50aWNhdGlvbi5zZXJ2aWNlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2JlYXJlci10b2tlbi5pbnRlcmNlcHRvcic7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9yZWdpc3Rlci5zZXJ2aWNlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NpZ24tb3V0LmRpcmVjdGl2ZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi90b2tlbnMnO1xuLy8gZW5kcmVnaW9uXG4iXX0=
|
|
@@ -1,76 +1,26 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
2
|
import { BehaviorSubject, ReplaySubject, } from 'rxjs';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export const RXAP_AUTHENTICATION_LOCAL_STORAGE_KEY = 'rxap__authenticated';
|
|
5
|
-
export function TimeoutPromise(callback, ms) {
|
|
6
|
-
return new Promise((resolve, reject) => {
|
|
7
|
-
setTimeout(() => {
|
|
8
|
-
callback(resolve, reject);
|
|
9
|
-
}, ms);
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
export function TimeoutResolve(value, ms) {
|
|
13
|
-
return new Promise(resolve => {
|
|
14
|
-
setTimeout(() => {
|
|
15
|
-
resolve(value);
|
|
16
|
-
}, ms);
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
4
|
export var AuthenticationEventType;
|
|
20
5
|
(function (AuthenticationEventType) {
|
|
21
6
|
AuthenticationEventType["OnAuthSuccess"] = "on-auth-success";
|
|
22
7
|
AuthenticationEventType["OnAuthError"] = "on-auth-error";
|
|
23
8
|
AuthenticationEventType["OnLogout"] = "on-logout";
|
|
24
9
|
})(AuthenticationEventType || (AuthenticationEventType = {}));
|
|
25
|
-
/* ignore coverage */
|
|
26
10
|
export class RxapAuthenticationService {
|
|
27
11
|
constructor() {
|
|
28
12
|
this.isAuthenticated$ = new BehaviorSubject(null);
|
|
29
13
|
this.events$ = new ReplaySubject();
|
|
30
|
-
|
|
14
|
+
this._authenticated = true;
|
|
31
15
|
this.isAuthenticated().then(isAuthenticated => this.isAuthenticated$.next(isAuthenticated));
|
|
32
16
|
}
|
|
33
|
-
requestPasswordReset(email) {
|
|
34
|
-
console.warn('The default RxapAuthenticationService implementation should only be used in a development environment!');
|
|
35
|
-
return TimeoutResolve(email !== 'fail@fail', 2500);
|
|
36
|
-
}
|
|
37
|
-
sendPasswordReset(password, token) {
|
|
38
|
-
console.warn('The default RxapAuthenticationService implementation should only be used in a development environment!');
|
|
39
|
-
return TimeoutResolve(password !== 'fail', 2500);
|
|
40
|
-
}
|
|
41
|
-
async signInWithEmailAndPassword(email, password, remember) {
|
|
42
|
-
console.warn('The default RxapAuthenticationService implementation should only be used in a development environment!');
|
|
43
|
-
return TimeoutPromise((resolve, reject) => {
|
|
44
|
-
const login = password !== 'fail';
|
|
45
|
-
this.isAuthenticated$.next(login);
|
|
46
|
-
if (login) {
|
|
47
|
-
if (remember) {
|
|
48
|
-
localStorage.setItem(RXAP_AUTHENTICATION_LOCAL_STORAGE_KEY, 'true');
|
|
49
|
-
}
|
|
50
|
-
resolve(login);
|
|
51
|
-
this.events$.next({ type: AuthenticationEventType.OnAuthSuccess });
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
localStorage.removeItem(RXAP_AUTHENTICATION_LOCAL_STORAGE_KEY);
|
|
55
|
-
reject(new Error('Login credentials are invalid'));
|
|
56
|
-
this.events$.next({ type: AuthenticationEventType.OnAuthError });
|
|
57
|
-
}
|
|
58
|
-
}, 2500);
|
|
59
|
-
}
|
|
60
17
|
async signOut() {
|
|
61
|
-
|
|
62
|
-
this.isAuthenticated$.next(
|
|
63
|
-
localStorage.removeItem(RXAP_AUTHENTICATION_LOCAL_STORAGE_KEY);
|
|
18
|
+
this._authenticated = false;
|
|
19
|
+
this.isAuthenticated$.next(this._authenticated);
|
|
64
20
|
this.events$.next({ type: AuthenticationEventType.OnLogout });
|
|
65
21
|
}
|
|
66
|
-
signInWithProvider(provider) {
|
|
67
|
-
console.warn('The default RxapAuthenticationService implementation should only be used in a development environment!');
|
|
68
|
-
return Promise.resolve(false);
|
|
69
|
-
}
|
|
70
22
|
isAuthenticated() {
|
|
71
|
-
return
|
|
72
|
-
resolve(localStorage.getItem(RXAP_AUTHENTICATION_LOCAL_STORAGE_KEY) === 'true');
|
|
73
|
-
}, 2500);
|
|
23
|
+
return Promise.resolve(this._authenticated);
|
|
74
24
|
}
|
|
75
25
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RxapAuthenticationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
76
26
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RxapAuthenticationService, providedIn: 'root' }); }
|
|
@@ -79,4 +29,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
79
29
|
type: Injectable,
|
|
80
30
|
args: [{ providedIn: 'root' }]
|
|
81
31
|
}], ctorParameters: function () { return []; } });
|
|
82
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aGVudGljYXRpb24uc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2FuZ3VsYXIvYXV0aGVudGljYXRpb24vc3JjL2xpYi9hdXRoZW50aWNhdGlvbi5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDM0MsT0FBTyxFQUNMLGVBQWUsRUFFZixhQUFhLEdBQ2QsTUFBTSxNQUFNLENBQUM7O0FBVWQsTUFBTSxDQUFOLElBQVksdUJBSVg7QUFKRCxXQUFZLHVCQUF1QjtJQUNqQyw0REFBaUMsQ0FBQTtJQUNqQyx3REFBNkIsQ0FBQTtJQUM3QixpREFBc0IsQ0FBQTtBQUN4QixDQUFDLEVBSlcsdUJBQXVCLEtBQXZCLHVCQUF1QixRQUlsQ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NhdGVkKCkudGhlbihpc0F1dGhlbnRpY2F0ZWQgPT4gdGhpcy5pc0F1dGhlbnRpY2F0ZWQkLm5leHQoaXNBdXRoZW50aWNhdGVkKSk7XG4gIH1cblxuICBwdWJsaWMgYXN5bmMgc2lnbk91dCgpOiBQcm9taXNlPHZvaWQ+IHtcbiAgICB0aGlzLl9hdXRoZW50aWNhdGVkID0gZmFsc2U7XG4gICAgdGhpcy5pc0F1dGhlbnRpY2F0ZWQkLm5leHQodGhpcy5fYXV0aGVudGljYXRlZCk7XG4gICAgdGhpcy5ldmVudHMkLm5leHQoeyB0eXBlOiBBdXRoZW50aWNhdGlvbkV2ZW50VHlwZS5PbkxvZ291dCB9KTtcbiAgfVxuXG4gIHB1YmxpYyBpc0F1dGhlbnRpY2F0ZWQoKTogUHJvbWlzZTxib29sZWFuPiB7XG4gICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZSh0aGlzLl9hdXRoZW50aWNhdGVkKTtcbiAgfVxuXG59XG4iXX0=
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { inject } from '@angular/core';
|
|
2
|
+
import { switchMap, take, } from 'rxjs';
|
|
3
|
+
import { RXAP_AUTHENTICATION_ACCESS_TOKEN } from './tokens';
|
|
4
|
+
export function BearerTokenInterceptor(req, next) {
|
|
5
|
+
const accessToken$ = inject(RXAP_AUTHENTICATION_ACCESS_TOKEN);
|
|
6
|
+
if (req.url.match(/https?:\/\/[^/]+\/api/)) {
|
|
7
|
+
return accessToken$.pipe(take(1), switchMap(accessToken => {
|
|
8
|
+
if (accessToken && (accessToken.valid === undefined || accessToken.valid)) {
|
|
9
|
+
console.debug('Add access token to request', req.url);
|
|
10
|
+
return next(req.clone({
|
|
11
|
+
setHeaders: {
|
|
12
|
+
Authorization: `Bearer ${accessToken.token}`,
|
|
13
|
+
},
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
console.debug('No valid access token found!', req.url);
|
|
18
|
+
}
|
|
19
|
+
return next(req);
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
console.debug('Skip adding access token to request', req.url);
|
|
24
|
+
}
|
|
25
|
+
return next(req);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmVhcmVyLXRva2VuLmludGVyY2VwdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhci9hdXRoZW50aWNhdGlvbi9zcmMvbGliL2JlYXJlci10b2tlbi5pbnRlcmNlcHRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLQSxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3ZDLE9BQU8sRUFFTCxTQUFTLEVBQ1QsSUFBSSxHQUNMLE1BQU0sTUFBTSxDQUFDO0FBQ2QsT0FBTyxFQUFFLGdDQUFnQyxFQUFFLE1BQU0sVUFBVSxDQUFDO0FBRTVELE1BQU0sVUFBVSxzQkFBc0IsQ0FBQyxHQUF5QixFQUFFLElBQW1CO0lBRW5GLE1BQU0sWUFBWSxHQUFHLE1BQU0sQ0FBQyxnQ0FBZ0MsQ0FBQyxDQUFDO0lBRTlELElBQUksR0FBRyxDQUFDLEdBQUcsQ0FBQyxLQUFLLENBQUMsdUJBQXVCLENBQUMsRUFBRTtRQUMxQyxPQUFPLFlBQVksQ0FBQyxJQUFJLENBQ3RCLElBQUksQ0FBQyxDQUFDLENBQUMsRUFDUCxTQUFTLENBQUMsV0FBVyxDQUFDLEVBQUU7WUFDdEIsSUFBSSxXQUFXLElBQUksQ0FBQyxXQUFXLENBQUMsS0FBSyxLQUFLLFNBQVMsSUFBSSxXQUFXLENBQUMsS0FBSyxDQUFDLEVBQUU7Z0JBQ3pFLE9BQU8sQ0FBQyxLQUFLLENBQUMsNkJBQTZCL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ANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
2
3
|
export const RXAP_AUTHENTICATION_DEACTIVATED = new InjectionToken('rxap/authentication/deactivated');
|
|
3
|
-
|
|
4
|
+
export const RXAP_AUTHENTICATION_ACCESS_TOKEN = new InjectionToken('rxap/authentication/access-token', {
|
|
5
|
+
providedIn: 'root',
|
|
6
|
+
factory: () => new BehaviorSubject(null),
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhci9hdXRoZW50aWNhdGlvbi9zcmMvbGliL3Rva2Vucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQy9DLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFFdkMsTUFBTSxDQUFDLE1BQU0sK0JBQStCLEdBQUcsSUFBSSxjQUFjLENBQVUsaUNBQWlDLENBQUMsQ0FBQztBQU85RyxNQUFNLENBQUMsTUFBTSxnQ0FBZ0MsR0FBRyxJQUFJLGNBQWMsQ0FDaEUsa0NBQWtDLEVBQ2xDO0lBQ0UsVUFBVSxFQUFFLE1BQU07SUFDbEIsT0FBTyxFQUFFLEdBQUcsRUFBRSxDQUFDLElBQUksZUFBZSxDQUFtQyxJQUFJLENBQUM7Q0FDM0UsQ0FDRixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSW5qZWN0aW9uVG9rZW4gfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IEJlaGF2aW9yU3ViamVjdCB9IGZyb20gJ3J4anMnO1xuXG5leHBvcnQgY29uc3QgUlhBUF9BVVRIRU5USUNBVElPTl9ERUFDVElWQVRFRCA9IG5ldyBJbmplY3Rpb25Ub2tlbjxib29sZWFuPigncnhhcC9hdXRoZW50aWNhdGlvbi9kZWFjdGl2YXRlZCcpO1xuXG5leHBvcnQgaW50ZXJmYWNlIEF1dGhlbnRpY2F0aW9uQWNjZXNzVG9rZW4gZXh0ZW5kcyBSZWNvcmQ8c3RyaW5nLCBhbnk+IHtcbiAgdG9rZW46IHN0cmluZztcbiAgdmFsaWQ/OiBib29sZWFuO1xufVxuXG5leHBvcnQgY29uc3QgUlhBUF9BVVRIRU5USUNBVElPTl9BQ0NFU1NfVE9LRU4gPSBuZXcgSW5qZWN0aW9uVG9rZW48QmVoYXZpb3JTdWJqZWN0PEF1dGhlbnRpY2F0aW9uQWNjZXNzVG9rZW4gfCBudWxsPj4oXG4gICdyeGFwL2F1dGhlbnRpY2F0aW9uL2FjY2Vzcy10b2tlbicsXG4gIHtcbiAgICBwcm92aWRlZEluOiAncm9vdCcsXG4gICAgZmFjdG9yeTogKCkgPT4gbmV3IEJlaGF2aW9yU3ViamVjdDxBdXRoZW50aWNhdGlvbkFjY2Vzc1Rva2VuIHwgbnVsbD4obnVsbCksXG4gIH0sXG4pO1xuIl19
|
|
@@ -1,80 +1,30 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, InjectionToken, Inject, Optional, EventEmitter, Directive, Output, HostListener } from '@angular/core';
|
|
3
|
-
import * as
|
|
2
|
+
import { Injectable, InjectionToken, Inject, Optional, inject, EventEmitter, Directive, Output, HostListener } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/router';
|
|
4
4
|
import { Router } from '@angular/router';
|
|
5
|
-
import { BehaviorSubject, ReplaySubject } from 'rxjs';
|
|
5
|
+
import { BehaviorSubject, ReplaySubject, take, switchMap } from 'rxjs';
|
|
6
6
|
import { tap } from 'rxjs/operators';
|
|
7
7
|
|
|
8
|
-
const RXAP_AUTHENTICATION_LOCAL_STORAGE_KEY = 'rxap__authenticated';
|
|
9
|
-
function TimeoutPromise(callback, ms) {
|
|
10
|
-
return new Promise((resolve, reject) => {
|
|
11
|
-
setTimeout(() => {
|
|
12
|
-
callback(resolve, reject);
|
|
13
|
-
}, ms);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
function TimeoutResolve(value, ms) {
|
|
17
|
-
return new Promise(resolve => {
|
|
18
|
-
setTimeout(() => {
|
|
19
|
-
resolve(value);
|
|
20
|
-
}, ms);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
8
|
var AuthenticationEventType;
|
|
24
9
|
(function (AuthenticationEventType) {
|
|
25
10
|
AuthenticationEventType["OnAuthSuccess"] = "on-auth-success";
|
|
26
11
|
AuthenticationEventType["OnAuthError"] = "on-auth-error";
|
|
27
12
|
AuthenticationEventType["OnLogout"] = "on-logout";
|
|
28
13
|
})(AuthenticationEventType || (AuthenticationEventType = {}));
|
|
29
|
-
/* ignore coverage */
|
|
30
14
|
class RxapAuthenticationService {
|
|
31
15
|
constructor() {
|
|
32
16
|
this.isAuthenticated$ = new BehaviorSubject(null);
|
|
33
17
|
this.events$ = new ReplaySubject();
|
|
34
|
-
|
|
18
|
+
this._authenticated = true;
|
|
35
19
|
this.isAuthenticated().then(isAuthenticated => this.isAuthenticated$.next(isAuthenticated));
|
|
36
20
|
}
|
|
37
|
-
requestPasswordReset(email) {
|
|
38
|
-
console.warn('The default RxapAuthenticationService implementation should only be used in a development environment!');
|
|
39
|
-
return TimeoutResolve(email !== 'fail@fail', 2500);
|
|
40
|
-
}
|
|
41
|
-
sendPasswordReset(password, token) {
|
|
42
|
-
console.warn('The default RxapAuthenticationService implementation should only be used in a development environment!');
|
|
43
|
-
return TimeoutResolve(password !== 'fail', 2500);
|
|
44
|
-
}
|
|
45
|
-
async signInWithEmailAndPassword(email, password, remember) {
|
|
46
|
-
console.warn('The default RxapAuthenticationService implementation should only be used in a development environment!');
|
|
47
|
-
return TimeoutPromise((resolve, reject) => {
|
|
48
|
-
const login = password !== 'fail';
|
|
49
|
-
this.isAuthenticated$.next(login);
|
|
50
|
-
if (login) {
|
|
51
|
-
if (remember) {
|
|
52
|
-
localStorage.setItem(RXAP_AUTHENTICATION_LOCAL_STORAGE_KEY, 'true');
|
|
53
|
-
}
|
|
54
|
-
resolve(login);
|
|
55
|
-
this.events$.next({ type: AuthenticationEventType.OnAuthSuccess });
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
localStorage.removeItem(RXAP_AUTHENTICATION_LOCAL_STORAGE_KEY);
|
|
59
|
-
reject(new Error('Login credentials are invalid'));
|
|
60
|
-
this.events$.next({ type: AuthenticationEventType.OnAuthError });
|
|
61
|
-
}
|
|
62
|
-
}, 2500);
|
|
63
|
-
}
|
|
64
21
|
async signOut() {
|
|
65
|
-
|
|
66
|
-
this.isAuthenticated$.next(
|
|
67
|
-
localStorage.removeItem(RXAP_AUTHENTICATION_LOCAL_STORAGE_KEY);
|
|
22
|
+
this._authenticated = false;
|
|
23
|
+
this.isAuthenticated$.next(this._authenticated);
|
|
68
24
|
this.events$.next({ type: AuthenticationEventType.OnLogout });
|
|
69
25
|
}
|
|
70
|
-
signInWithProvider(provider) {
|
|
71
|
-
console.warn('The default RxapAuthenticationService implementation should only be used in a development environment!');
|
|
72
|
-
return Promise.resolve(false);
|
|
73
|
-
}
|
|
74
26
|
isAuthenticated() {
|
|
75
|
-
return
|
|
76
|
-
resolve(localStorage.getItem(RXAP_AUTHENTICATION_LOCAL_STORAGE_KEY) === 'true');
|
|
77
|
-
}, 2500);
|
|
27
|
+
return Promise.resolve(this._authenticated);
|
|
78
28
|
}
|
|
79
29
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RxapAuthenticationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
80
30
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RxapAuthenticationService, providedIn: 'root' }); }
|
|
@@ -85,6 +35,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
85
35
|
}], ctorParameters: function () { return []; } });
|
|
86
36
|
|
|
87
37
|
const RXAP_AUTHENTICATION_DEACTIVATED = new InjectionToken('rxap/authentication/deactivated');
|
|
38
|
+
const RXAP_AUTHENTICATION_ACCESS_TOKEN = new InjectionToken('rxap/authentication/access-token', {
|
|
39
|
+
providedIn: 'root',
|
|
40
|
+
factory: () => new BehaviorSubject(null),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
class AuthenticationRoutingService {
|
|
44
|
+
constructor(router, authenticationService, deactivated = null) {
|
|
45
|
+
this.router = router;
|
|
46
|
+
this.authenticationService = authenticationService;
|
|
47
|
+
this.deactivated = deactivated;
|
|
48
|
+
if (!deactivated) {
|
|
49
|
+
console.log('Authentication is enabled');
|
|
50
|
+
this.authenticationService.isAuthenticated$.pipe(tap(isAuthenticated => {
|
|
51
|
+
if (isAuthenticated) {
|
|
52
|
+
return this.router.navigate(['/']);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return this.router.navigate(['/', 'authentication', 'login']);
|
|
56
|
+
}
|
|
57
|
+
})).subscribe();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AuthenticationRoutingService, deps: [{ token: Router }, { token: RxapAuthenticationService }, { token: RXAP_AUTHENTICATION_DEACTIVATED, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
61
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AuthenticationRoutingService, providedIn: 'root' }); }
|
|
62
|
+
}
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AuthenticationRoutingService, decorators: [{
|
|
64
|
+
type: Injectable,
|
|
65
|
+
args: [{
|
|
66
|
+
providedIn: 'root',
|
|
67
|
+
}]
|
|
68
|
+
}], ctorParameters: function () { return [{ type: i1.Router, decorators: [{
|
|
69
|
+
type: Inject,
|
|
70
|
+
args: [Router]
|
|
71
|
+
}] }, { type: RxapAuthenticationService, decorators: [{
|
|
72
|
+
type: Inject,
|
|
73
|
+
args: [RxapAuthenticationService]
|
|
74
|
+
}] }, { type: undefined, decorators: [{
|
|
75
|
+
type: Optional
|
|
76
|
+
}, {
|
|
77
|
+
type: Inject,
|
|
78
|
+
args: [RXAP_AUTHENTICATION_DEACTIVATED]
|
|
79
|
+
}] }]; } });
|
|
88
80
|
|
|
89
81
|
class RxapAuthenticationGuard {
|
|
90
82
|
constructor(authentication, router, deactivated = null) {
|
|
@@ -179,7 +171,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
179
171
|
}], ctorParameters: function () { return [{ type: RxapAuthenticationService, decorators: [{
|
|
180
172
|
type: Inject,
|
|
181
173
|
args: [RxapAuthenticationService]
|
|
182
|
-
}] }, { type:
|
|
174
|
+
}] }, { type: i1.Router, decorators: [{
|
|
183
175
|
type: Inject,
|
|
184
176
|
args: [Router]
|
|
185
177
|
}] }, { type: undefined, decorators: [{
|
|
@@ -189,6 +181,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
189
181
|
args: [RXAP_AUTHENTICATION_DEACTIVATED]
|
|
190
182
|
}] }]; } });
|
|
191
183
|
|
|
184
|
+
function BearerTokenInterceptor(req, next) {
|
|
185
|
+
const accessToken$ = inject(RXAP_AUTHENTICATION_ACCESS_TOKEN);
|
|
186
|
+
if (req.url.match(/https?:\/\/[^/]+\/api/)) {
|
|
187
|
+
return accessToken$.pipe(take(1), switchMap(accessToken => {
|
|
188
|
+
if (accessToken && (accessToken.valid === undefined || accessToken.valid)) {
|
|
189
|
+
console.debug('Add access token to request', req.url);
|
|
190
|
+
return next(req.clone({
|
|
191
|
+
setHeaders: {
|
|
192
|
+
Authorization: `Bearer ${accessToken.token}`,
|
|
193
|
+
},
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
console.debug('No valid access token found!', req.url);
|
|
198
|
+
}
|
|
199
|
+
return next(req);
|
|
200
|
+
}));
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
console.debug('Skip adding access token to request', req.url);
|
|
204
|
+
}
|
|
205
|
+
return next(req);
|
|
206
|
+
}
|
|
207
|
+
|
|
192
208
|
/* ignore coverage */
|
|
193
209
|
class RegisterService {
|
|
194
210
|
constructor() {
|
|
@@ -205,57 +221,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
205
221
|
args: [{ providedIn: 'root' }]
|
|
206
222
|
}], ctorParameters: function () { return []; } });
|
|
207
223
|
|
|
208
|
-
/* ignore coverage */
|
|
209
|
-
class UserService {
|
|
210
|
-
constructor() {
|
|
211
|
-
this.user$ = new BehaviorSubject(null);
|
|
212
|
-
}
|
|
213
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
214
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserService, providedIn: 'root' }); }
|
|
215
|
-
}
|
|
216
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserService, decorators: [{
|
|
217
|
-
type: Injectable,
|
|
218
|
-
args: [{ providedIn: 'root' }]
|
|
219
|
-
}] });
|
|
220
|
-
|
|
221
|
-
class AuthenticationRoutingService {
|
|
222
|
-
constructor(router, authenticationService, deactivated = null) {
|
|
223
|
-
this.router = router;
|
|
224
|
-
this.authenticationService = authenticationService;
|
|
225
|
-
this.deactivated = deactivated;
|
|
226
|
-
if (!deactivated) {
|
|
227
|
-
console.log('Authentication is enabled');
|
|
228
|
-
this.authenticationService.isAuthenticated$.pipe(tap(isAuthenticated => {
|
|
229
|
-
if (isAuthenticated) {
|
|
230
|
-
return this.router.navigate(['/']);
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
return this.router.navigate(['/', 'authentication', 'login']);
|
|
234
|
-
}
|
|
235
|
-
})).subscribe();
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AuthenticationRoutingService, deps: [{ token: Router }, { token: RxapAuthenticationService }, { token: RXAP_AUTHENTICATION_DEACTIVATED, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
239
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AuthenticationRoutingService, providedIn: 'root' }); }
|
|
240
|
-
}
|
|
241
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AuthenticationRoutingService, decorators: [{
|
|
242
|
-
type: Injectable,
|
|
243
|
-
args: [{
|
|
244
|
-
providedIn: 'root',
|
|
245
|
-
}]
|
|
246
|
-
}], ctorParameters: function () { return [{ type: i2.Router, decorators: [{
|
|
247
|
-
type: Inject,
|
|
248
|
-
args: [Router]
|
|
249
|
-
}] }, { type: RxapAuthenticationService, decorators: [{
|
|
250
|
-
type: Inject,
|
|
251
|
-
args: [RxapAuthenticationService]
|
|
252
|
-
}] }, { type: undefined, decorators: [{
|
|
253
|
-
type: Optional
|
|
254
|
-
}, {
|
|
255
|
-
type: Inject,
|
|
256
|
-
args: [RXAP_AUTHENTICATION_DEACTIVATED]
|
|
257
|
-
}] }]; } });
|
|
258
|
-
|
|
259
224
|
class SignOutDirective {
|
|
260
225
|
constructor(auth) {
|
|
261
226
|
this.auth = auth;
|
|
@@ -289,45 +254,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
289
254
|
args: ['click']
|
|
290
255
|
}] } });
|
|
291
256
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
this.profile = {
|
|
295
|
-
username: 'rxap',
|
|
296
|
-
email: 'rxap@digitaix.dev',
|
|
297
|
-
firstName: 'Rxap',
|
|
298
|
-
lastName: 'DigitAIX',
|
|
299
|
-
name: 'Rxap DigitAIX',
|
|
300
|
-
img: 'icon.png',
|
|
301
|
-
language: 'en',
|
|
302
|
-
roleList: ['user.*', '*.edit'],
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
async getProfile() {
|
|
306
|
-
return { ...this.profile };
|
|
307
|
-
}
|
|
308
|
-
async setProfile(profile) {
|
|
309
|
-
this.profile = profile;
|
|
310
|
-
}
|
|
311
|
-
async setLanguage(language) {
|
|
312
|
-
this.profile.language = language;
|
|
313
|
-
}
|
|
314
|
-
async getLanguage() {
|
|
315
|
-
return this.profile?.language ?? null;
|
|
316
|
-
}
|
|
317
|
-
async getRoleList() {
|
|
318
|
-
return this.profile.roleList ?? [];
|
|
319
|
-
}
|
|
320
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RxapUserProfileService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
321
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RxapUserProfileService, providedIn: 'root' }); }
|
|
322
|
-
}
|
|
323
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RxapUserProfileService, decorators: [{
|
|
324
|
-
type: Injectable,
|
|
325
|
-
args: [{ providedIn: 'root' }]
|
|
326
|
-
}] });
|
|
257
|
+
// region
|
|
258
|
+
// endregion
|
|
327
259
|
|
|
328
260
|
/**
|
|
329
261
|
* Generated bundle index. Do not edit.
|
|
330
262
|
*/
|
|
331
263
|
|
|
332
|
-
export { AuthenticationEventType, AuthenticationRoutingService,
|
|
264
|
+
export { AuthenticationEventType, AuthenticationRoutingService, BearerTokenInterceptor, RXAP_AUTHENTICATION_ACCESS_TOKEN, RXAP_AUTHENTICATION_DEACTIVATED, RegisterService, RxapAuthenticationGuard, RxapAuthenticationService, SignOutDirective };
|
|
333
265
|
//# sourceMappingURL=rxap-authentication.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxap-authentication.mjs","sources":["../../../../../packages/angular/authentication/src/lib/authentication.service.ts","../../../../../packages/angular/authentication/src/lib/tokens.ts","../../../../../packages/angular/authentication/src/lib/authentication.guard.ts","../../../../../packages/angular/authentication/src/lib/register.service.ts","../../../../../packages/angular/authentication/src/lib/user.service.ts","../../../../../packages/angular/authentication/src/lib/authentication-routing.service.ts","../../../../../packages/angular/authentication/src/lib/sign-out.directive.ts","../../../../../packages/angular/authentication/src/lib/user-profile.service.ts","../../../../../packages/angular/authentication/src/rxap-authentication.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n BehaviorSubject,\n Observable,\n ReplaySubject,\n} from 'rxjs';\n\nexport const RXAP_AUTHENTICATION_LOCAL_STORAGE_KEY = 'rxap__authenticated';\n\nexport interface IAuthenticationService {\n isAuthenticated$: Observable<boolean | null>;\n\n requestPasswordReset(email: string): Promise<boolean>;\n\n sendPasswordReset(password: string, token: string): Promise<boolean>;\n\n signInWithEmailAndPassword(email: string, password: string, remember: boolean): Promise<boolean>;\n\n signOut(): Promise<void>;\n\n}\n\nexport function TimeoutPromise<T>(\n callback: (resolve: (value: T) => void, reject: (error: any) => void) => void,\n ms: number,\n): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n\n setTimeout(() => {\n callback(resolve, reject);\n }, ms);\n\n });\n}\n\nexport function TimeoutResolve<T>(value: T, ms: number): Promise<T> {\n return new Promise(resolve => {\n\n setTimeout(() => {\n resolve(value);\n }, ms);\n\n });\n}\n\nexport enum AuthenticationEventType {\n OnAuthSuccess = 'on-auth-success',\n OnAuthError = 'on-auth-error',\n OnLogout = 'on-logout',\n}\n\nexport interface AuthenticationEvent extends Record<string, any> {\n type: AuthenticationEventType;\n}\n\n@Injectable({ providedIn: 'root' })\n/* ignore coverage */\nexport class RxapAuthenticationService implements IAuthenticationService {\n\n public isAuthenticated$ = new BehaviorSubject<boolean | null>(null);\n\n public readonly events$ = new ReplaySubject<AuthenticationEvent>();\n\n constructor() {\n console.warn(\n 'The default RxapAuthenticationService implementation should only be used in a development environment!');\n this.isAuthenticated().then(isAuthenticated => this.isAuthenticated$.next(isAuthenticated));\n }\n\n public requestPasswordReset(email: string): Promise<boolean> {\n console.warn(\n 'The default RxapAuthenticationService implementation should only be used in a development environment!');\n return TimeoutResolve(email !== 'fail@fail', 2500);\n }\n\n public sendPasswordReset(password: string, token: string): Promise<boolean> {\n console.warn(\n 'The default RxapAuthenticationService implementation should only be used in a development environment!');\n return TimeoutResolve(password !== 'fail', 2500);\n }\n\n public async signInWithEmailAndPassword(email: string, password: string, remember: boolean): Promise<boolean> {\n console.warn(\n 'The default RxapAuthenticationService implementation should only be used in a development environment!');\n return TimeoutPromise((resolve, reject) => {\n\n const login = password !== 'fail';\n this.isAuthenticated$.next(login);\n if (login) {\n if (remember) {\n localStorage.setItem(RXAP_AUTHENTICATION_LOCAL_STORAGE_KEY, 'true');\n }\n resolve(login);\n this.events$.next({ type: AuthenticationEventType.OnAuthSuccess });\n } else {\n localStorage.removeItem(RXAP_AUTHENTICATION_LOCAL_STORAGE_KEY);\n reject(new Error('Login credentials are invalid'));\n this.events$.next({ type: AuthenticationEventType.OnAuthError });\n }\n\n }, 2500);\n\n }\n\n public async signOut(): Promise<void> {\n console.warn(\n 'The default RxapAuthenticationService implementation should only be used in a development environment!');\n this.isAuthenticated$.next(false);\n localStorage.removeItem(RXAP_AUTHENTICATION_LOCAL_STORAGE_KEY);\n this.events$.next({ type: AuthenticationEventType.OnLogout });\n }\n\n public signInWithProvider(provider: string): Promise<boolean> {\n console.warn(\n 'The default RxapAuthenticationService implementation should only be used in a development environment!');\n return Promise.resolve(false);\n }\n\n public isAuthenticated(): Promise<boolean> {\n return TimeoutPromise((resolve) => {\n resolve(localStorage.getItem(RXAP_AUTHENTICATION_LOCAL_STORAGE_KEY) === 'true');\n }, 2500);\n }\n\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const RXAP_AUTHENTICATION_DEACTIVATED = new InjectionToken<boolean>('rxap/authentication/deactivated');\n","import {\n Inject,\n Injectable,\n Optional,\n} from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n Router,\n RouterStateSnapshot,\n UrlTree,\n} from '@angular/router';\nimport { RxapAuthenticationService } from './authentication.service';\nimport { RXAP_AUTHENTICATION_DEACTIVATED } from './tokens';\n\n@Injectable({ providedIn: 'root' })\nexport class RxapAuthenticationGuard {\n\n public lastUrl: string | null = null;\n\n constructor(\n @Inject(RxapAuthenticationService)\n public authentication: RxapAuthenticationService,\n @Inject(Router)\n public router: Router,\n @Optional()\n @Inject(RXAP_AUTHENTICATION_DEACTIVATED)\n private readonly deactivated: boolean | null = null,\n ) {\n }\n\n public canActivate(\n route: ActivatedRouteSnapshot,\n state: RouterStateSnapshot,\n ): Promise<UrlTree | boolean> {\n console.debug('[RxapAuthenticationGuard] can activate', state.url);\n return this.checkAuthStatus(route, state);\n }\n\n public canActivateChild(\n childRoute: ActivatedRouteSnapshot,\n state: RouterStateSnapshot,\n ): Promise<UrlTree | boolean> {\n console.debug('[RxapAuthenticationGuard] can activate child', state.url);\n return this.checkAuthStatus(childRoute, state);\n }\n\n private async checkAuthStatus(\n route: ActivatedRouteSnapshot,\n state: RouterStateSnapshot,\n ): Promise<UrlTree | boolean> {\n\n if (this.deactivated) {\n return true;\n }\n\n const authenticated = await this.authentication.isAuthenticated();\n\n if (authenticated === null) {\n if (!this.lastUrl || (state.url !== '/' && !state.url.match(/authentication\\/login/))) {\n this.lastUrl = state.url;\n }\n return this.router.createUrlTree([ '/', 'authentication', 'loading' ]);\n }\n if (authenticated) {\n if (this.lastUrl && (state.url/*?*/ === '/' || state.url.match(/authentication\\/login/))) {\n const lastUrl = this.lastUrl;\n this.lastUrl = null;\n return this.createUrlTreeToLastUrl(lastUrl);\n } else {\n if (state.url.match(/authentication/)) {\n if (state.url.match(/authentication\\/reset-password/)) {\n return true;\n }\n return this.router.createUrlTree([ '/' ]);\n } else {\n this.lastUrl = null;\n return true;\n }\n }\n } else {\n if (!state.url.match(/^\\/?authentication/)) {\n this.lastUrl = state.url;\n }\n if (state.url.match(/^\\/?authentication/)) {\n if (this.lastUrl && this.lastUrl.match(/^\\/?authentication/)) {\n const lastUrl = this.lastUrl;\n this.lastUrl = null;\n return this.createUrlTreeToLastUrl(lastUrl);\n }\n return true;\n } else {\n return this.router.createUrlTree([ '/', 'authentication', 'login' ]);\n }\n }\n\n }\n\n private createUrlTreeToLastUrl(lastUrl: string): UrlTree {\n\n const urlMatch = lastUrl.match(/^([^?#]+)(\\?([^#]+))?(#(.+))?$/);\n\n if (urlMatch) {\n\n let queryParams: Record<string, string> = {};\n\n if (urlMatch[3]) {\n const queryParamsString = urlMatch[3];\n queryParams = queryParamsString.split('&').map(param => {\n const split = param.split('=');\n return { [split[0]]: split[1] };\n }).reduce((params, param) => ({ ...params, ...param }), {});\n }\n\n let fragment: string | undefined = undefined;\n\n if (urlMatch[5]) {\n fragment = urlMatch[5];\n }\n\n return this.router.createUrlTree([ urlMatch[1] ], {\n queryParams,\n fragment,\n });\n\n }\n\n return this.router.createUrlTree([ lastUrl ]);\n\n }\n\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\n/* ignore coverage */\nexport class RegisterService {\n\n constructor() {\n console.warn('The default RegisterService implementation should only be used in a development environment!');\n }\n\n public register(email: string, password: string): Promise<boolean> {\n return Promise.resolve(true);\n }\n\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\nexport interface UserProfile {\n username: string;\n firstname?: string;\n lastname?: string;\n name?: string;\n email: string;\n photoURL?: string;\n avatarUrl?: string;\n}\n\n@Injectable({ providedIn: 'root' })\n/* ignore coverage */\nexport class UserService<User extends UserProfile = UserProfile> {\n\n public user$ = new BehaviorSubject<User | null>(null);\n\n}\n","import {\n Inject,\n Injectable,\n Optional,\n} from '@angular/core';\nimport { Router } from '@angular/router';\nimport { RxapAuthenticationService } from './authentication.service';\nimport { RXAP_AUTHENTICATION_DEACTIVATED } from './tokens';\nimport { tap } from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AuthenticationRoutingService {\n\n constructor(\n @Inject(Router)\n private readonly router: Router,\n @Inject(RxapAuthenticationService)\n private readonly authenticationService: RxapAuthenticationService,\n @Optional()\n @Inject(RXAP_AUTHENTICATION_DEACTIVATED)\n private readonly deactivated: boolean | null = null,\n ) {\n if (!deactivated) {\n console.log('Authentication is enabled');\n this.authenticationService.isAuthenticated$.pipe(\n tap(isAuthenticated => {\n if (isAuthenticated) {\n return this.router.navigate([ '/' ]);\n } else {\n return this.router.navigate([ '/', 'authentication', 'login' ]);\n }\n }),\n ).subscribe();\n }\n }\n\n}\n","import {\n Directive,\n EventEmitter,\n HostListener,\n Output,\n} from '@angular/core';\nimport { RxapAuthenticationService } from './authentication.service';\n\n@Directive({\n selector: '[rxapSignOut]',\n standalone: true,\n})\nexport class SignOutDirective {\n\n @Output()\n public successful = new EventEmitter<void>();\n\n @Output()\n public failure = new EventEmitter<Error>();\n\n constructor(private readonly auth: RxapAuthenticationService) {\n }\n\n @HostListener('click')\n public async onClick() {\n try {\n await this.auth.signOut();\n this.successful.emit();\n } catch (e: any) {\n this.failure.emit(e);\n }\n }\n\n}\n\n\n","import { Injectable } from '@angular/core';\n\nexport interface RxapUserProfile {\n username?: string;\n email?: string;\n firstName?: string;\n lastName?: string;\n name?: string;\n img?: string;\n language?: string;\n roleList?: string[];\n}\n\n@Injectable({ providedIn: 'root' })\nexport class RxapUserProfileService {\n\n profile: RxapUserProfile = {\n username: 'rxap',\n email: 'rxap@digitaix.dev',\n firstName: 'Rxap',\n lastName: 'DigitAIX',\n name: 'Rxap DigitAIX',\n img: 'icon.png',\n language: 'en',\n roleList: [ 'user.*', '*.edit' ],\n };\n\n async getProfile(): Promise<RxapUserProfile | null> {\n return { ...this.profile };\n }\n\n async setProfile(profile: RxapUserProfile): Promise<void> {\n this.profile = profile;\n }\n\n async setLanguage(language: string): Promise<void> {\n this.profile.language = language;\n }\n\n async getLanguage(): Promise<string | null> {\n return this.profile?.language ?? null;\n }\n\n async getRoleList(): Promise<string[]> {\n return this.profile.roleList ?? [];\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.RxapAuthenticationService"],"mappings":";;;;;;;AAOO,MAAM,qCAAqC,GAAG,sBAAsB;AAe3D,SAAA,cAAc,CAC5B,QAA6E,EAC7E,EAAU,EAAA;IAEV,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,KAAI;QAExC,UAAU,CAAC,MAAK;AACd,YAAA,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAC3B,EAAE,EAAE,CAAC,CAAC;AAET,KAAC,CAAC,CAAC;AACL,CAAC;AAEe,SAAA,cAAc,CAAI,KAAQ,EAAE,EAAU,EAAA;AACpD,IAAA,OAAO,IAAI,OAAO,CAAC,OAAO,IAAG;QAE3B,UAAU,CAAC,MAAK;YACd,OAAO,CAAC,KAAK,CAAC,CAAC;SAChB,EAAE,EAAE,CAAC,CAAC;AAET,KAAC,CAAC,CAAC;AACL,CAAC;IAEW,wBAIX;AAJD,CAAA,UAAY,uBAAuB,EAAA;AACjC,IAAA,uBAAA,CAAA,eAAA,CAAA,GAAA,iBAAiC,CAAA;AACjC,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,CAAC;KACvC;AAED,IAAA,MAAM,WAAW,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC;KACpC;8GA/BU,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,cADT,MAAM,EAAA,CAAA,CAAA,EAAA;;2FACnB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;ACblC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"rxap-authentication.mjs","sources":["../../../../../packages/angular/authentication/src/lib/authentication.service.ts","../../../../../packages/angular/authentication/src/lib/tokens.ts","../../../../../packages/angular/authentication/src/lib/authentication-routing.service.ts","../../../../../packages/angular/authentication/src/lib/authentication.guard.ts","../../../../../packages/angular/authentication/src/lib/bearer-token.interceptor.ts","../../../../../packages/angular/authentication/src/lib/register.service.ts","../../../../../packages/angular/authentication/src/lib/sign-out.directive.ts","../../../../../packages/angular/authentication/src/index.ts","../../../../../packages/angular/authentication/src/rxap-authentication.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n BehaviorSubject,\n Observable,\n ReplaySubject,\n} from 'rxjs';\n\nexport interface IAuthenticationService {\n isAuthenticated$: Observable<boolean | null>;\n events$: Observable<AuthenticationEvent>;\n signOut(): Promise<void>;\n\n isAuthenticated(): Promise<boolean>;\n}\n\nexport enum AuthenticationEventType {\n OnAuthSuccess = 'on-auth-success',\n OnAuthError = 'on-auth-error',\n OnLogout = 'on-logout',\n}\n\nexport interface AuthenticationEvent extends Record<string, any> {\n type: AuthenticationEventType;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class RxapAuthenticationService implements IAuthenticationService {\n\n public isAuthenticated$ = new BehaviorSubject<boolean | null>(null);\n\n public readonly events$ = new ReplaySubject<AuthenticationEvent>();\n\n private _authenticated = true;\n\n constructor() {\n this.isAuthenticated().then(isAuthenticated => this.isAuthenticated$.next(isAuthenticated));\n }\n\n public async signOut(): Promise<void> {\n this._authenticated = false;\n this.isAuthenticated$.next(this._authenticated);\n this.events$.next({ type: AuthenticationEventType.OnLogout });\n }\n\n public isAuthenticated(): Promise<boolean> {\n return Promise.resolve(this._authenticated);\n }\n\n}\n","import { InjectionToken } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\nexport const RXAP_AUTHENTICATION_DEACTIVATED = new InjectionToken<boolean>('rxap/authentication/deactivated');\n\nexport interface AuthenticationAccessToken extends Record<string, any> {\n token: string;\n valid?: boolean;\n}\n\nexport const RXAP_AUTHENTICATION_ACCESS_TOKEN = new InjectionToken<BehaviorSubject<AuthenticationAccessToken | null>>(\n 'rxap/authentication/access-token',\n {\n providedIn: 'root',\n factory: () => new BehaviorSubject<AuthenticationAccessToken | null>(null),\n },\n);\n","import {\n Inject,\n Injectable,\n Optional,\n} from '@angular/core';\nimport { Router } from '@angular/router';\nimport { RxapAuthenticationService } from './authentication.service';\nimport { RXAP_AUTHENTICATION_DEACTIVATED } from './tokens';\nimport { tap } from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AuthenticationRoutingService {\n\n constructor(\n @Inject(Router)\n private readonly router: Router,\n @Inject(RxapAuthenticationService)\n private readonly authenticationService: RxapAuthenticationService,\n @Optional()\n @Inject(RXAP_AUTHENTICATION_DEACTIVATED)\n private readonly deactivated: boolean | null = null,\n ) {\n if (!deactivated) {\n console.log('Authentication is enabled');\n this.authenticationService.isAuthenticated$.pipe(\n tap(isAuthenticated => {\n if (isAuthenticated) {\n return this.router.navigate([ '/' ]);\n } else {\n return this.router.navigate([ '/', 'authentication', 'login' ]);\n }\n }),\n ).subscribe();\n }\n }\n\n}\n","import {\n Inject,\n Injectable,\n Optional,\n} from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n Router,\n RouterStateSnapshot,\n UrlTree,\n} from '@angular/router';\nimport { RxapAuthenticationService } from './authentication.service';\nimport { RXAP_AUTHENTICATION_DEACTIVATED } from './tokens';\n\n@Injectable({ providedIn: 'root' })\nexport class RxapAuthenticationGuard {\n\n public lastUrl: string | null = null;\n\n constructor(\n @Inject(RxapAuthenticationService)\n public authentication: RxapAuthenticationService,\n @Inject(Router)\n public router: Router,\n @Optional()\n @Inject(RXAP_AUTHENTICATION_DEACTIVATED)\n private readonly deactivated: boolean | null = null,\n ) {\n }\n\n public canActivate(\n route: ActivatedRouteSnapshot,\n state: RouterStateSnapshot,\n ): Promise<UrlTree | boolean> {\n console.debug('[RxapAuthenticationGuard] can activate', state.url);\n return this.checkAuthStatus(route, state);\n }\n\n public canActivateChild(\n childRoute: ActivatedRouteSnapshot,\n state: RouterStateSnapshot,\n ): Promise<UrlTree | boolean> {\n console.debug('[RxapAuthenticationGuard] can activate child', state.url);\n return this.checkAuthStatus(childRoute, state);\n }\n\n private async checkAuthStatus(\n route: ActivatedRouteSnapshot,\n state: RouterStateSnapshot,\n ): Promise<UrlTree | boolean> {\n\n if (this.deactivated) {\n return true;\n }\n\n const authenticated = await this.authentication.isAuthenticated();\n\n if (authenticated === null) {\n if (!this.lastUrl || (state.url !== '/' && !state.url.match(/authentication\\/login/))) {\n this.lastUrl = state.url;\n }\n return this.router.createUrlTree([ '/', 'authentication', 'loading' ]);\n }\n if (authenticated) {\n if (this.lastUrl && (state.url/*?*/ === '/' || state.url.match(/authentication\\/login/))) {\n const lastUrl = this.lastUrl;\n this.lastUrl = null;\n return this.createUrlTreeToLastUrl(lastUrl);\n } else {\n if (state.url.match(/authentication/)) {\n if (state.url.match(/authentication\\/reset-password/)) {\n return true;\n }\n return this.router.createUrlTree([ '/' ]);\n } else {\n this.lastUrl = null;\n return true;\n }\n }\n } else {\n if (!state.url.match(/^\\/?authentication/)) {\n this.lastUrl = state.url;\n }\n if (state.url.match(/^\\/?authentication/)) {\n if (this.lastUrl && this.lastUrl.match(/^\\/?authentication/)) {\n const lastUrl = this.lastUrl;\n this.lastUrl = null;\n return this.createUrlTreeToLastUrl(lastUrl);\n }\n return true;\n } else {\n return this.router.createUrlTree([ '/', 'authentication', 'login' ]);\n }\n }\n\n }\n\n private createUrlTreeToLastUrl(lastUrl: string): UrlTree {\n\n const urlMatch = lastUrl.match(/^([^?#]+)(\\?([^#]+))?(#(.+))?$/);\n\n if (urlMatch) {\n\n let queryParams: Record<string, string> = {};\n\n if (urlMatch[3]) {\n const queryParamsString = urlMatch[3];\n queryParams = queryParamsString.split('&').map(param => {\n const split = param.split('=');\n return { [split[0]]: split[1] };\n }).reduce((params, param) => ({ ...params, ...param }), {});\n }\n\n let fragment: string | undefined = undefined;\n\n if (urlMatch[5]) {\n fragment = urlMatch[5];\n }\n\n return this.router.createUrlTree([ urlMatch[1] ], {\n queryParams,\n fragment,\n });\n\n }\n\n return this.router.createUrlTree([ lastUrl ]);\n\n }\n\n}\n","import {\n HttpEvent,\n HttpHandlerFn,\n HttpRequest,\n} from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport {\n Observable,\n switchMap,\n take,\n} from 'rxjs';\nimport { RXAP_AUTHENTICATION_ACCESS_TOKEN } from './tokens';\n\nexport function BearerTokenInterceptor(req: HttpRequest<unknown>, next: HttpHandlerFn): Observable<HttpEvent<unknown>> {\n\n const accessToken$ = inject(RXAP_AUTHENTICATION_ACCESS_TOKEN);\n\n if (req.url.match(/https?:\\/\\/[^/]+\\/api/)) {\n return accessToken$.pipe(\n take(1),\n switchMap(accessToken => {\n if (accessToken && (accessToken.valid === undefined || accessToken.valid)) {\n console.debug('Add access token to request', req.url);\n return next(req.clone({\n setHeaders: {\n Authorization: `Bearer ${ accessToken.token }`,\n },\n }));\n } else {\n console.debug('No valid access token found!', req.url);\n }\n return next(req);\n }),\n );\n } else {\n console.debug('Skip adding access token to request', req.url);\n }\n\n return next(req);\n\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\n/* ignore coverage */\nexport class RegisterService {\n\n constructor() {\n console.warn('The default RegisterService implementation should only be used in a development environment!');\n }\n\n public register(email: string, password: string): Promise<boolean> {\n return Promise.resolve(true);\n }\n\n}\n","import {\n Directive,\n EventEmitter,\n HostListener,\n Output,\n} from '@angular/core';\nimport { RxapAuthenticationService } from './authentication.service';\n\n@Directive({\n selector: '[rxapSignOut]',\n standalone: true,\n})\nexport class SignOutDirective {\n\n @Output()\n public successful = new EventEmitter<void>();\n\n @Output()\n public failure = new EventEmitter<Error>();\n\n constructor(private readonly auth: RxapAuthenticationService) {\n }\n\n @HostListener('click')\n public async onClick() {\n try {\n await this.auth.signOut();\n this.successful.emit();\n } catch (e: any) {\n this.failure.emit(e);\n }\n }\n\n}\n\n\n","// region \nexport * from './lib/authentication-routing.service';\nexport * from './lib/authentication.guard';\nexport * from './lib/authentication.service';\nexport * from './lib/bearer-token.interceptor';\nexport * from './lib/register.service';\nexport * from './lib/sign-out.directive';\nexport * from './lib/tokens';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.RxapAuthenticationService"],"mappings":";;;;;;;IAeY,wBAIX;AAJD,CAAA,UAAY,uBAAuB,EAAA;AACjC,IAAA,uBAAA,CAAA,eAAA,CAAA,GAAA,iBAAiC,CAAA;AACjC,IAAA,uBAAA,CAAA,aAAA,CAAA,GAAA,eAA6B,CAAA;AAC7B,IAAA,uBAAA,CAAA,UAAA,CAAA,GAAA,WAAsB,CAAA;AACxB,CAAC,EAJW,uBAAuB,KAAvB,uBAAuB,GAIlC,EAAA,CAAA,CAAA,CAAA;MAOY,yBAAyB,CAAA;AAQpC,IAAA,WAAA,GAAA;AANO,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,eAAe,CAAiB,IA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A,EAAA,SAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,WAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA,CAAA;6GAIQ,UAAU,EAAA,CAAA;sBADhB,MAAM;gBAIA,OAAO,EAAA,CAAA;sBADb,MAAM;gBAOM,OAAO,EAAA,CAAA;sBADnB,YAAY;uBAAC,OAAO,CAAA;;;ACvBvB;AAQA;;ACRA;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
export * from './lib/authentication-routing.service';
|
|
1
2
|
export * from './lib/authentication.guard';
|
|
2
3
|
export * from './lib/authentication.service';
|
|
4
|
+
export * from './lib/bearer-token.interceptor';
|
|
3
5
|
export * from './lib/register.service';
|
|
4
|
-
export * from './lib/user.service';
|
|
5
|
-
export * from './lib/authentication-routing.service';
|
|
6
|
-
export * from './lib/tokens';
|
|
7
6
|
export * from './lib/sign-out.directive';
|
|
8
|
-
export * from './lib/
|
|
7
|
+
export * from './lib/tokens';
|