@rxap/authentication 16.0.0-dev.9 → 16.0.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/README.md +1 -1
  3. package/esm2022/index.mjs +6 -5
  4. package/esm2022/lib/authentication.service.mjs +7 -56
  5. package/esm2022/lib/bearer-token.interceptor.mjs +27 -0
  6. package/esm2022/lib/tokens.mjs +17 -2
  7. package/fesm2022/rxap-authentication.mjs +87 -145
  8. package/fesm2022/rxap-authentication.mjs.map +1 -1
  9. package/index.d.ts +3 -4
  10. package/lib/authentication.service.d.ts +3 -10
  11. package/lib/bearer-token.interceptor.d.ts +3 -0
  12. package/lib/tokens.d.ts +9 -1
  13. package/package.json +33 -49
  14. package/theme.css +1 -1
  15. package/components/index.d.ts +0 -8
  16. package/components/lib/authentication-container/authentication-container.component.d.ts +0 -7
  17. package/components/lib/fade-animation.d.ts +0 -1
  18. package/components/lib/loading/loading.component.d.ts +0 -15
  19. package/components/lib/login/login.component.d.ts +0 -13
  20. package/components/lib/login/login.form.d.ts +0 -43
  21. package/components/lib/reset-password/reset-password.component.d.ts +0 -5
  22. package/components/lib/reset-password/reset-password.form.d.ts +0 -35
  23. package/components/lib/routes.d.ts +0 -2
  24. package/esm2022/components/index.mjs +0 -9
  25. package/esm2022/components/lib/authentication-container/authentication-container.component.mjs +0 -38
  26. package/esm2022/components/lib/fade-animation.mjs +0 -14
  27. package/esm2022/components/lib/loading/loading.component.mjs +0 -39
  28. package/esm2022/components/lib/login/login.component.mjs +0 -104
  29. package/esm2022/components/lib/login/login.form.mjs +0 -108
  30. package/esm2022/components/lib/reset-password/reset-password.component.mjs +0 -53
  31. package/esm2022/components/lib/reset-password/reset-password.form.mjs +0 -117
  32. package/esm2022/components/lib/routes.mjs +0 -32
  33. package/esm2022/components/rxap-authentication-components.mjs +0 -5
  34. package/esm2022/lib/user-profile.service.mjs +0 -38
  35. package/esm2022/lib/user.service.mjs +0 -16
  36. package/fesm2022/rxap-authentication-components.mjs +0 -453
  37. package/fesm2022/rxap-authentication-components.mjs.map +0 -1
  38. package/lib/user-profile.service.d.ts +0 -21
  39. package/lib/user.service.d.ts +0 -16
@@ -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,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;AAOD;MACa,yBAAyB,CAAA;AAMpC,IAAA,WAAA,GAAA;AAJO,QAAA,IAAA,C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,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/tokens.ts","../../../../../packages/angular/authentication/src/lib/authentication.service.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 {\n InjectionToken,\n Provider,\n} 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\nexport const RXAP_INITIAL_AUTHENTICATION_STATE = new InjectionToken<boolean>('rxap/authentication/initial-state', {\n providedIn: 'root',\n factory: () => false,\n});\n\nexport function withDisabledAuthentication(disabled = true): Provider {\n return {\n provide: RXAP_AUTHENTICATION_DEACTIVATED,\n useValue: disabled,\n };\n}\n","import {\n inject,\n Injectable,\n} from '@angular/core';\nimport {\n BehaviorSubject,\n Observable,\n ReplaySubject,\n} from 'rxjs';\nimport { RXAP_INITIAL_AUTHENTICATION_STATE } from './tokens';\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 = inject(RXAP_INITIAL_AUTHENTICATION_STATE);\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 {\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":";;;;;;;MAMa,+BAA+B,GAAG,IAAI,cAAc,CAAU,iCAAiC,EAAE;MAOjG,gCAAgC,GAAG,IAAI,cAAc,CAChE,kCAAkC,EAClC;AACE,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAM,IAAI,eAAe,CAAmC,IAAI,CAAC;AAC3E,CAAA,EACD;MAEW,iCAAiC,GAAG,IAAI,cAAc,CAAU,mCAAmC,EAAE;AAChH,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,KAAK;AACrB,CAAA,EAAE;AAEa,SAAA,0BAA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YAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACtB,SAAA;KACF;8GAnBU,gBAAgB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAA,yBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,OAAA,EAAA,EAAA,UAAA,EAAA,YAAA,EAAA,OAAA,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/user-profile.service';
7
+ export * from './lib/tokens';
@@ -1,15 +1,11 @@
1
1
  import { BehaviorSubject, Observable, ReplaySubject } from 'rxjs';
2
2
  import * as i0 from "@angular/core";
3
- export declare const RXAP_AUTHENTICATION_LOCAL_STORAGE_KEY = "rxap__authenticated";
4
3
  export interface IAuthenticationService {
5
4
  isAuthenticated$: Observable<boolean | null>;
6
- requestPasswordReset(email: string): Promise<boolean>;
7
- sendPasswordReset(password: string, token: string): Promise<boolean>;
8
- signInWithEmailAndPassword(email: string, password: string, remember: boolean): Promise<boolean>;
5
+ events$: Observable<AuthenticationEvent>;
9
6
  signOut(): Promise<void>;
7
+ isAuthenticated(): Promise<boolean>;
10
8
  }
11
- export declare function TimeoutPromise<T>(callback: (resolve: (value: T) => void, reject: (error: any) => void) => void, ms: number): Promise<T>;
12
- export declare function TimeoutResolve<T>(value: T, ms: number): Promise<T>;
13
9
  export declare enum AuthenticationEventType {
14
10
  OnAuthSuccess = "on-auth-success",
15
11
  OnAuthError = "on-auth-error",
@@ -21,12 +17,9 @@ export interface AuthenticationEvent extends Record<string, any> {
21
17
  export declare class RxapAuthenticationService implements IAuthenticationService {
22
18
  isAuthenticated$: BehaviorSubject<boolean | null>;
23
19
  readonly events$: ReplaySubject<AuthenticationEvent>;
20
+ private _authenticated;
24
21
  constructor();
25
- requestPasswordReset(email: string): Promise<boolean>;
26
- sendPasswordReset(password: string, token: string): Promise<boolean>;
27
- signInWithEmailAndPassword(email: string, password: string, remember: boolean): Promise<boolean>;
28
22
  signOut(): Promise<void>;
29
- signInWithProvider(provider: string): Promise<boolean>;
30
23
  isAuthenticated(): Promise<boolean>;
31
24
  static ɵfac: i0.ɵɵFactoryDeclaration<RxapAuthenticationService, never>;
32
25
  static ɵprov: i0.ɵɵInjectableDeclaration<RxapAuthenticationService>;
@@ -0,0 +1,3 @@
1
+ import { HttpEvent, HttpHandlerFn, HttpRequest } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ export declare function BearerTokenInterceptor(req: HttpRequest<unknown>, next: HttpHandlerFn): Observable<HttpEvent<unknown>>;
package/lib/tokens.d.ts CHANGED
@@ -1,2 +1,10 @@
1
- import { InjectionToken } from '@angular/core';
1
+ import { InjectionToken, Provider } from '@angular/core';
2
+ import { BehaviorSubject } from 'rxjs';
2
3
  export declare const RXAP_AUTHENTICATION_DEACTIVATED: InjectionToken<boolean>;
4
+ export interface AuthenticationAccessToken extends Record<string, any> {
5
+ token: string;
6
+ valid?: boolean;
7
+ }
8
+ export declare const RXAP_AUTHENTICATION_ACCESS_TOKEN: InjectionToken<BehaviorSubject<AuthenticationAccessToken | null>>;
9
+ export declare const RXAP_INITIAL_AUTHENTICATION_STATE: InjectionToken<boolean>;
10
+ export declare function withDisabledAuthentication(disabled?: boolean): Provider;
package/package.json CHANGED
@@ -1,74 +1,64 @@
1
1
  {
2
+ "version": "16.0.0",
2
3
  "name": "@rxap/authentication",
3
- "version": "16.0.0-dev.9",
4
+ "description": "A collection of components and services to simplify the authentication process implementation.",
5
+ "license": "GPL-3.0-or-later",
6
+ "dependencies": {
7
+ "tslib": "2.6.2"
8
+ },
4
9
  "peerDependencies": {
5
- "@angular/animations": "^16.1.4",
6
10
  "@angular/common": "^16.1.4",
7
11
  "@angular/core": "^16.1.4",
8
- "@angular/flex-layout": "^15.0.0-beta.42",
9
- "@angular/forms": "^16.1.4",
10
- "@angular/material": "^16.1.4",
11
12
  "@angular/router": "^16.1.4",
12
- "@rxap/config": "^16.0.0-dev.9",
13
- "@rxap/forms": "^16.0.0-dev.8",
14
- "@rxap/rxjs": "^1.0.1-dev.2",
15
- "@rxap/utilities": "^16.0.0-dev.6",
16
- "rxjs": "^7.8.0",
17
- "@angular/platform-browser": "16.1.4"
13
+ "rxjs": "^7.8.1"
18
14
  },
19
- "sideEffects": false,
20
- "dependencies": {
21
- "tslib": "2.5.3"
15
+ "author": {
16
+ "name": "Merzough Münker",
17
+ "email": "mmuenker@digitaix.com"
22
18
  },
23
- "publishConfig": {
24
- "access": "public",
25
- "directory": "../../../dist/packages/angular/authentication"
19
+ "bugs": {
20
+ "url": "https://gitlab.com/rxap/packages/-/issues",
21
+ "email": "incoming+rxap-packages-14898188-issue-@incoming.gitlab.com"
26
22
  },
23
+ "homepage": "https:/gitlab.com/rxap/packages/packages/angular/authentication",
27
24
  "keywords": [
28
- "rxap",
29
25
  "angular",
26
+ "angular-authentication",
27
+ "authentication",
30
28
  "ngx",
31
29
  "packages",
32
- "authentication",
33
- "angular-authentication"
30
+ "rxap"
34
31
  ],
35
- "description": "A collection of components and services to simplify the authentication process implementation.",
36
- "homepage": "https:/gitlab.com/rxap/packages/packages/angular/authentication",
37
- "bugs": {
38
- "url": "https://gitlab.com/rxap/packages/-/issues",
39
- "email": "incoming+rxap-packages-14898188-issue-@incoming.gitlab.com"
40
- },
41
- "license": "GPL-3.0-or-later",
42
- "repository": {
43
- "type": "git",
44
- "url": "https://gitlab.com/rxap/packages.git",
45
- "directory": "packages/angular/authentication"
46
- },
47
- "author": {
48
- "name": "Merzough Münker",
49
- "email": "mmuenker@digitaix.com"
50
- },
51
32
  "nx-migrations": {
52
33
  "packageGroup": [
53
34
  {
54
35
  "package": "@rxap/config",
55
- "version": "16.0.0-dev.9"
36
+ "version": "16.0.0-dev.15"
56
37
  },
57
38
  {
58
- "package": "@rxap/rxjs",
59
- "version": "1.0.1-dev.2"
39
+ "package": "@rxap/forms",
40
+ "version": "16.0.0-dev.16"
60
41
  },
61
42
  {
62
- "package": "@rxap/forms",
63
- "version": "16.0.0-dev.8"
43
+ "package": "@rxap/rxjs",
44
+ "version": "1.0.1-dev.10"
64
45
  },
65
46
  {
66
47
  "package": "@rxap/utilities",
67
- "version": "16.0.0-dev.6"
48
+ "version": "16.0.0-dev.17"
68
49
  }
69
50
  ]
70
51
  },
71
- "gitHead": "3d49d0a2548a0c403ad55c564108b54ba734a677",
52
+ "publishConfig": {
53
+ "access": "public",
54
+ "directory": "../../../dist/packages/angular/authentication"
55
+ },
56
+ "repository": {
57
+ "type": "git",
58
+ "url": "https://gitlab.com/rxap/packages.git",
59
+ "directory": "packages/angular/authentication"
60
+ },
61
+ "sideEffects": false,
72
62
  "module": "fesm2022/rxap-authentication.mjs",
73
63
  "typings": "index.d.ts",
74
64
  "exports": {
@@ -81,12 +71,6 @@
81
71
  "esm": "./esm2022/rxap-authentication.mjs",
82
72
  "default": "./fesm2022/rxap-authentication.mjs"
83
73
  },
84
- "./components": {
85
- "types": "./components/index.d.ts",
86
- "esm2022": "./esm2022/components/rxap-authentication-components.mjs",
87
- "esm": "./esm2022/components/rxap-authentication-components.mjs",
88
- "default": "./fesm2022/rxap-authentication-components.mjs"
89
- },
90
74
  "./theme": "./theme.css"
91
75
  }
92
76
  }
package/theme.css CHANGED
@@ -1 +1 @@
1
- .container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.block{display:block}.inline{display:inline}.table{display:table}.contents{display:contents}.hidden{display:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.invert{--tw-invert:invert(100%)}.filter,.invert{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}
1
+ .visible{visibility:visible}.static{position:static}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.block{display:block}.inline{display:inline}.contents{display:contents}.hidden{display:none}.capitalize{text-transform:capitalize}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}
@@ -1,8 +0,0 @@
1
- export * from './lib/login/login.form';
2
- export * from './lib/login/login.component';
3
- export * from './lib/login/login.form';
4
- export * from './lib/routes';
5
- export * from './lib/loading/loading.component';
6
- export * from './lib/reset-password/reset-password.component';
7
- export * from './lib/authentication-container/authentication-container.component';
8
- export * from './lib/fade-animation';
@@ -1,7 +0,0 @@
1
- import { RouterOutlet } from '@angular/router';
2
- import * as i0 from "@angular/core";
3
- export declare class AuthenticationContainerComponent {
4
- prepareRoute(outlet: RouterOutlet): import("@angular/router").ActivatedRoute | "true";
5
- static ɵfac: i0.ɵɵFactoryDeclaration<AuthenticationContainerComponent, never>;
6
- static ɵcmp: i0.ɵɵComponentDeclaration<AuthenticationContainerComponent, "rxap-authentication-container", never, {}, {}, never, ["*"], true, never>;
7
- }
@@ -1 +0,0 @@
1
- export declare const fadeAnimation: import("@angular/animations").AnimationTriggerMetadata;
@@ -1,15 +0,0 @@
1
- import { OnDestroy, OnInit } from '@angular/core';
2
- import { Subscription } from 'rxjs';
3
- import { RxapAuthenticationService } from '@rxap/authentication';
4
- import { Router } from '@angular/router';
5
- import * as i0 from "@angular/core";
6
- export declare class LoadingComponent implements OnInit, OnDestroy {
7
- readonly authentication: RxapAuthenticationService;
8
- readonly router: Router;
9
- subscription?: Subscription;
10
- constructor(authentication: RxapAuthenticationService, router: Router);
11
- ngOnInit(): void;
12
- ngOnDestroy(): void;
13
- static ɵfac: i0.ɵɵFactoryDeclaration<LoadingComponent, never>;
14
- static ɵcmp: i0.ɵɵComponentDeclaration<LoadingComponent, "rxap-auth-loading", never, {}, {}, never, never, true, never>;
15
- }
@@ -1,13 +0,0 @@
1
- import { RxapAuthenticationService } from '@rxap/authentication';
2
- import { MatSnackBar } from '@angular/material/snack-bar';
3
- import { ToggleSubject } from '@rxap/rxjs';
4
- import * as i0 from "@angular/core";
5
- export declare class LoginComponent {
6
- private readonly authentication;
7
- private readonly snackBar;
8
- readonly requestingPasswordReset$: ToggleSubject;
9
- constructor(authentication: RxapAuthenticationService, snackBar: MatSnackBar);
10
- requestPasswordReset(email: string): Promise<void>;
11
- static ɵfac: i0.ɵɵFactoryDeclaration<LoginComponent, never>;
12
- static ɵcmp: i0.ɵɵComponentDeclaration<LoginComponent, "rxap-login", never, {}, {}, never, never, true, never>;
13
- }
@@ -1,43 +0,0 @@
1
- import { Provider } from '@angular/core';
2
- import { RxapAuthenticationService } from '@rxap/authentication';
3
- import { FormSubmitMethod, FormSubmitSuccessfulMethod, FormType, RxapFormControl, RxapFormGroup } from '@rxap/forms';
4
- import { ConfigService } from '@rxap/config';
5
- import { RxapOnInit } from '@rxap/utilities';
6
- import { Router } from '@angular/router';
7
- import * as i0 from "@angular/core";
8
- export interface ILoginForm {
9
- email: string;
10
- password: string;
11
- }
12
- export declare class LoginForm implements FormType<ILoginForm>, RxapOnInit {
13
- readonly config: ConfigService<any>;
14
- rxapFormGroup: RxapFormGroup;
15
- loading: boolean;
16
- loginFailed: boolean;
17
- email: RxapFormControl<string>;
18
- password: RxapFormControl;
19
- remember: RxapFormControl;
20
- constructor(config: ConfigService<any>);
21
- rxapOnInit(): void;
22
- static ɵfac: i0.ɵɵFactoryDeclaration<LoginForm, never>;
23
- static ɵprov: i0.ɵɵInjectableDeclaration<LoginForm>;
24
- }
25
- export declare class LoginFormSubmitMethod implements FormSubmitMethod<any> {
26
- private readonly authentication;
27
- constructor(authentication: RxapAuthenticationService);
28
- call(value: {
29
- email: string;
30
- password: string;
31
- remember: boolean;
32
- }): Promise<any>;
33
- static ɵfac: i0.ɵɵFactoryDeclaration<LoginFormSubmitMethod, never>;
34
- static ɵprov: i0.ɵɵInjectableDeclaration<LoginFormSubmitMethod>;
35
- }
36
- export declare class LoginFormSubmitSuccessful implements FormSubmitSuccessfulMethod<any> {
37
- private readonly router;
38
- constructor(router: Router);
39
- call(): Promise<any>;
40
- static ɵfac: i0.ɵɵFactoryDeclaration<LoginFormSubmitSuccessful, never>;
41
- static ɵprov: i0.ɵɵInjectableDeclaration<LoginFormSubmitSuccessful>;
42
- }
43
- export declare const LoginFormProviders: Provider[];
@@ -1,5 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare class ResetPasswordComponent {
3
- static ɵfac: i0.ɵɵFactoryDeclaration<ResetPasswordComponent, never>;
4
- static ɵcmp: i0.ɵɵComponentDeclaration<ResetPasswordComponent, "rxap-reset-password", never, {}, {}, never, never, true, never>;
5
- }
@@ -1,35 +0,0 @@
1
- import { Provider } from '@angular/core';
2
- import { RxapAuthenticationService } from '@rxap/authentication';
3
- import { ActivatedRoute, Router } from '@angular/router';
4
- import { FormSubmitMethod, FormType, RxapFormControl, RxapFormGroup } from '@rxap/forms';
5
- import { MatSnackBar } from '@angular/material/snack-bar';
6
- import * as i0 from "@angular/core";
7
- export declare const RXAP_RESET_PASSWORD_FORM = "rxap-reset-password";
8
- export declare class ResetPasswordFormSubmitMethod implements FormSubmitMethod<any> {
9
- private readonly route;
10
- private readonly authentication;
11
- private readonly snackBar;
12
- private readonly router;
13
- constructor(route: ActivatedRoute, authentication: RxapAuthenticationService, snackBar: MatSnackBar, router: Router);
14
- call(value: {
15
- password: string;
16
- }): boolean | Promise<boolean>;
17
- static ɵfac: i0.ɵɵFactoryDeclaration<ResetPasswordFormSubmitMethod, never>;
18
- static ɵprov: i0.ɵɵInjectableDeclaration<ResetPasswordFormSubmitMethod>;
19
- }
20
- export interface IResetPasswordForm {
21
- password: string;
22
- passwordRepeat: string;
23
- }
24
- export declare class ResetPasswordForm implements FormType<IResetPasswordForm> {
25
- rxapFormGroup: RxapFormGroup;
26
- password: RxapFormControl;
27
- passwordRepeat: RxapFormControl;
28
- passwordEqual(control: RxapFormControl): {
29
- equal: string;
30
- } | null;
31
- resetRepeat(): void;
32
- static ɵfac: i0.ɵɵFactoryDeclaration<ResetPasswordForm, never>;
33
- static ɵprov: i0.ɵɵInjectableDeclaration<ResetPasswordForm>;
34
- }
35
- export declare const ResetPasswordFormProviders: Provider[];
@@ -1,2 +0,0 @@
1
- import { Routes } from '@angular/router';
2
- export declare const AuthenticationRoutes: Routes;
@@ -1,9 +0,0 @@
1
- export * from './lib/login/login.form';
2
- export * from './lib/login/login.component';
3
- export * from './lib/login/login.form';
4
- export * from './lib/routes';
5
- export * from './lib/loading/loading.component';
6
- export * from './lib/reset-password/reset-password.component';
7
- export * from './lib/authentication-container/authentication-container.component';
8
- export * from './lib/fade-animation';
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hbmd1bGFyL2F1dGhlbnRpY2F0aW9uL2NvbXBvbmVudHMvc3JjL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyw2QkFBNkIsQ0FBQztBQUM1QyxjQUFjLHdCQUF3QixDQUFDO0FBRXZDLGNBQWMsY0FBYyxDQUFDO0FBRTdCLGNBQWMsaUNBQWlDLENBQUM7QUFFaEQsY0FBYywrQ0FBK0MsQ0FBQztBQUM5RCxjQUFjLG1FQUFtRSxDQUFDO0FBRWxGLGNBQWMsc0JBQXNCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2xpYi9sb2dpbi9sb2dpbi5mb3JtJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2xvZ2luL2xvZ2luLmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9sb2dpbi9sb2dpbi5mb3JtJztcblxuZXhwb3J0ICogZnJvbSAnLi9saWIvcm91dGVzJztcblxuZXhwb3J0ICogZnJvbSAnLi9saWIvbG9hZGluZy9sb2FkaW5nLmNvbXBvbmVudCc7XG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL3Jlc2V0LXBhc3N3b3JkL3Jlc2V0LXBhc3N3b3JkLmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9hdXRoZW50aWNhdGlvbi1jb250YWluZXIvYXV0aGVudGljYXRpb24tY29udGFpbmVyLmNvbXBvbmVudCc7XG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL2ZhZGUtYW5pbWF0aW9uJztcbiJdfQ==
@@ -1,38 +0,0 @@
1
- import { Component } from '@angular/core';
2
- import { RouterOutlet } from '@angular/router';
3
- import { animate, style, transition, trigger, } from '@angular/animations';
4
- import * as i0 from "@angular/core";
5
- export class AuthenticationContainerComponent {
6
- prepareRoute(outlet) {
7
- return outlet.isActivated ? outlet.activatedRoute : 'true';
8
- }
9
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AuthenticationContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: AuthenticationContainerComponent, isStandalone: true, selector: "rxap-authentication-container", ngImport: i0, template: "<div [@routeAnimations]=\"prepareRoute(outlet)\" class=\"content\">\n\n <div class=\"split mat-elevation-z3\"></div>\n\n <router-outlet #outlet=\"outlet\"></router-outlet>\n <ng-content></ng-content>\n\n</div>\n", styles: [".content{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center;overflow-x:hidden}.content .split{position:absolute;top:0;left:0;right:0;bottom:65vh;z-index:-10;background-color:var(--accent-color)}\n"], dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], animations: [
11
- trigger('routeAnimations', [
12
- transition(':enter', [
13
- style({ opacity: 0 }),
14
- animate('512ms', style({ opacity: 1 })),
15
- ]),
16
- transition(':leave', [
17
- style({ opacity: 1 }),
18
- animate('512ms', style({ opacity: 0 })),
19
- ]),
20
- ]),
21
- ] }); }
22
- }
23
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AuthenticationContainerComponent, decorators: [{
24
- type: Component,
25
- args: [{ selector: 'rxap-authentication-container', animations: [
26
- trigger('routeAnimations', [
27
- transition(':enter', [
28
- style({ opacity: 0 }),
29
- animate('512ms', style({ opacity: 1 })),
30
- ]),
31
- transition(':leave', [
32
- style({ opacity: 1 }),
33
- animate('512ms', style({ opacity: 0 })),
34
- ]),
35
- ]),
36
- ], standalone: true, imports: [RouterOutlet], template: "<div [@routeAnimations]=\"prepareRoute(outlet)\" class=\"content\">\n\n <div class=\"split mat-elevation-z3\"></div>\n\n <router-outlet #outlet=\"outlet\"></router-outlet>\n <ng-content></ng-content>\n\n</div>\n", styles: [".content{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center;overflow-x:hidden}.content .split{position:absolute;top:0;left:0;right:0;bottom:65vh;z-index:-10;background-color:var(--accent-color)}\n"] }]
37
- }] });
38
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aGVudGljYXRpb24tY29udGFpbmVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2FuZ3VsYXIvYXV0aGVudGljYXRpb24vY29tcG9uZW50cy9zcmMvbGliL2F1dGhlbnRpY2F0aW9uLWNvbnRhaW5lci9hdXRoZW50aWNhdGlvbi1jb250YWluZXIuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhci9hdXRoZW50aWNhdGlvbi9jb21wb25lbnRzL3NyYy9saWIvYXV0aGVudGljYXRpb24tY29udGFpbmVyL2F1dGhlbnRpY2F0aW9uLWNvbnRhaW5lci5jb21wb25lbnQuaHRtbCJdLCJuYW1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mltYXRpb25zOiBbXG4gICAgdHJpZ2dlcigncm91dGVBbmltYXRpb25zJywgW1xuICAgICAgdHJhbnNpdGlvbignOmVudGVyJywgW1xuICAgICAgICBzdHlsZSh7IG9wYWNpdHk6IDAgfSksXG4gICAgICAgIGFuaW1hdGUoJzUxMm1zJywgc3R5bGUoeyBvcGFjaXR5OiAxIH0pKSxcbiAgICAgIF0pLFxuICAgICAgdHJhbnNpdGlvbignOmxlYXZlJywgW1xuICAgICAgICBzdHlsZSh7IG9wYWNpdHk6IDEgfSksXG4gICAgICAgIGFuaW1hdGUoJzUxMm1zJywgc3R5bGUoeyBvcGFjaXR5OiAwIH0pKSxcbiAgICAgIF0pLFxuICAgIF0pLFxuICBdLFxuICBzdGFuZGFsb25lOiB0cnVlLFxuICBpbXBvcnRzOiBbIFJvdXRlck91dGxldCBdLFxufSlcbmV4cG9ydCBjbGFzcyBBdXRoZW50aWNhdGlvbkNvbnRhaW5lckNvbXBvbmVudCB7XG5cbiAgcHVibGljIHByZXBhcmVSb3V0ZShvdXRsZXQ6IFJvdXRlck91dGxldCkge1xuICAgIHJldHVybiBvdXRsZXQuaXNBY3RpdmF0ZWQgPyBvdXRsZXQuYWN0aXZhdGVkUm91dGUgOiAndHJ1ZSc7XG4gIH1cblxufVxuIiwiPGRpdiBbQHJvdXRlQW5pbWF0aW9uc109XCJwcmVwYXJlUm91dGUob3V0bGV0KVwiIGNsYXNzPVwiY29udGVudFwiPlxuXG4gIDxkaXYgY2xhc3M9XCJzcGxpdCBtYXQtZWxldmF0aW9uLXozXCI+PC9kaXY+XG5cbiAgPHJvdXRlci1vdXRsZXQgI291dGxldD1cIm91dGxldFwiPjwvcm91dGVyLW91dGxldD5cbiAgPG5nLWNvbnRlbnQ+PC9uZy1jb250ZW50PlxuXG48L2Rpdj5cbiJdfQ==
@@ -1,14 +0,0 @@
1
- // the fade-in/fade-out animation.
2
- import { animate, state, style, transition, trigger, } from '@angular/animations';
3
- export const fadeAnimation = trigger('fadeAnimation', [
4
- // the "in" style determines the "resting" state of the element when it is visible.
5
- state('in', style({ opacity: 1 })),
6
- // fade in when created. this could also be written as transition('void => *')
7
- transition(':enter', [
8
- style({ opacity: 0 }),
9
- animate(300),
10
- ]),
11
- // fade out when destroyed. this could also be written as transition('void => *')
12
- transition(':leave', animate(300, style({ opacity: 0 }))),
13
- ]);
14
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFkZS1hbmltYXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hbmd1bGFyL2F1dGhlbnRpY2F0aW9uL2NvbXBvbmVudHMvc3JjL2xpYi9mYWRlLWFuaW1hdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxrQ0FBa0M7QUFDbEMsT0FBTyxFQUNMLE9BQU8sRUFDUCxLQUFLLEVBQ0wsS0FBSyxFQUNMLFVBQVUsRUFDVixPQUFPLEdBQ1IsTUFBTSxxQkFBcUIsQ0FBQztBQUU3QixNQUFNLENBQUMsTUFBTSxhQUFhLEdBQUcsT0FBTyxDQUFDLGVBQWUsRUFBRTtJQUVwRCxtRkFBbUY7SUFDbkYsS0FBSyxDQUFDLElBQUksRUFBRSxLQUFLLENBQUMsRUFBRSxPQUFPLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQztJQUVsQyw4RUFBOEU7SUFDOUUsVUFBVSxDQUFDLFFBQVEsRUFBRTtRQUNuQixLQUFLLENBQUMsRUFBRSxPQUFPLEVBQUUsQ0FBQyxFQUFFLENBQUM7UUFDckIsT0FBTyxDQUFDLEdBQUcsQ0FBQztLQUNiLENBQUM7SUFFRixpRkFBaUY7SUFDakYsVUFBVSxDQUNSLFFBQVEsRUFDUixPQUFPLENBQUMsR0FBRyxFQUFFLEtBQUssQ0FBQyxFQUFFLE9BQU8sRUFBRSxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQ3BDO0NBQ0YsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLy8gdGhlIGZhZGUtaW4vZmFkZS1vdXQgYW5pbWF0aW9uLlxuaW1wb3J0IHtcbiAgYW5pbWF0ZSxcbiAgc3RhdGUsXG4gIHN0eWxlLFxuICB0cmFuc2l0aW9uLFxuICB0cmlnZ2VyLFxufSBmcm9tICdAYW5ndWxhci9hbmltYXRpb25zJztcblxuZXhwb3J0IGNvbnN0IGZhZGVBbmltYXRpb24gPSB0cmlnZ2VyKCdmYWRlQW5pbWF0aW9uJywgW1xuXG4gIC8vIHRoZSBcImluXCIgc3R5bGUgZGV0ZXJtaW5lcyB0aGUgXCJyZXN0aW5nXCIgc3RhdGUgb2YgdGhlIGVsZW1lbnQgd2hlbiBpdCBpcyB2aXNpYmxlLlxuICBzdGF0ZSgnaW4nLCBzdHlsZSh7IG9wYWNpdHk6IDEgfSkpLFxuXG4gIC8vIGZhZGUgaW4gd2hlbiBjcmVhdGVkLiB0aGlzIGNvdWxkIGFsc28gYmUgd3JpdHRlbiBhcyB0cmFuc2l0aW9uKCd2b2lkID0+IConKVxuICB0cmFuc2l0aW9uKCc6ZW50ZXInLCBbXG4gICAgc3R5bGUoeyBvcGFjaXR5OiAwIH0pLFxuICAgIGFuaW1hdGUoMzAwKSxcbiAgXSksXG5cbiAgLy8gZmFkZSBvdXQgd2hlbiBkZXN0cm95ZWQuIHRoaXMgY291bGQgYWxzbyBiZSB3cml0dGVuIGFzIHRyYW5zaXRpb24oJ3ZvaWQgPT4gKicpXG4gIHRyYW5zaXRpb24oXG4gICAgJzpsZWF2ZScsXG4gICAgYW5pbWF0ZSgzMDAsIHN0eWxlKHsgb3BhY2l0eTogMCB9KSksXG4gICksXG5dKTtcbiJdfQ==
@@ -1,39 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, Inject, } from '@angular/core';
2
- import { RxapAuthenticationService } from '@rxap/authentication';
3
- import { filter, tap, } from 'rxjs/operators';
4
- import { Router } from '@angular/router';
5
- import { MatProgressBarModule } from '@angular/material/progress-bar';
6
- import * as i0 from "@angular/core";
7
- import * as i1 from "@angular/material/progress-bar";
8
- import * as i2 from "@rxap/authentication";
9
- import * as i3 from "@angular/router";
10
- export class LoadingComponent {
11
- constructor(authentication, router) {
12
- this.authentication = authentication;
13
- this.router = router;
14
- }
15
- ngOnInit() {
16
- // TODO : remove the concept of isAuthenticated$
17
- if (this.authentication.isAuthenticated$) {
18
- this.subscription = this.authentication.isAuthenticated$
19
- .pipe(filter((isAuthenticated) => isAuthenticated !== null), tap(() => this.router.navigate(['/', 'authentication', 'login'])))
20
- .subscribe();
21
- }
22
- }
23
- ngOnDestroy() {
24
- this.subscription?.unsubscribe();
25
- }
26
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LoadingComponent, deps: [{ token: RxapAuthenticationService }, { token: Router }], target: i0.ɵɵFactoryTarget.Component }); }
27
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: LoadingComponent, isStandalone: true, selector: "rxap-auth-loading", ngImport: i0, template: "<mat-progress-bar class=\"loading-bar\" mode=\"indeterminate\"></mat-progress-bar>\n", styles: [".loading-bar{position:absolute;bottom:65vh;left:0;right:0;top:auto}\n"], dependencies: [{ kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
28
- }
29
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LoadingComponent, decorators: [{
30
- type: Component,
31
- args: [{ selector: 'rxap-auth-loading', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatProgressBarModule], template: "<mat-progress-bar class=\"loading-bar\" mode=\"indeterminate\"></mat-progress-bar>\n", styles: [".loading-bar{position:absolute;bottom:65vh;left:0;right:0;top:auto}\n"] }]
32
- }], ctorParameters: function () { return [{ type: i2.RxapAuthenticationService, decorators: [{
33
- type: Inject,
34
- args: [RxapAuthenticationService]
35
- }] }, { type: i3.Router, decorators: [{
36
- type: Inject,
37
- args: [Router]
38
- }] }]; } });
39
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZGluZy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hbmd1bGFyL2F1dGhlbnRpY2F0aW9uL2NvbXBvbmVudHMvc3JjL2xpYi9sb2FkaW5nL2xvYWRpbmcuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhci9hdXRoZW50aWNhdGlvbi9jb21wb25lbnRzL3NyYy9saWIvbG9hZGluZy9sb2FkaW5nLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCx1QkFBdUIsRUFDdkIsU0FBUyxFQUNULE1BQU0sR0FHUCxNQUFNLGVBQWUsQ0FBQztBQUV2QixPQUFPLEVBQUUseUJBQXlCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNqRSxPQUFPLEVBQ0wsTUFBTSxFQUNOLEdBQUcsR0FDSixNQUFNLGdCQUFnQixDQUFDO0FBQ3hCLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUN6QyxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQzs7Ozs7QUFVdEUsTUFBTSxPQUFPLGdCQUFnQjtJQUczQixZQUVrQixjQUF5QyxFQUV6QyxNQUFjO1FBRmQsbUJBQWMsR0FBZCxjQU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