UNPKG

@rxap/authentication

Version:

Provides authentication services, guards, and interceptors for Angular applications. It supports token-based authentication and provides features such as sign-out functionality and routing based on authentication status. This package also includes utiliti

104 lines (52 loc) 2.65 kB
[**@rxap/authentication v19.0.4**](../README.md) *** [@rxap/authentication](../globals.md) / RxapAuthenticationGuard # Class: RxapAuthenticationGuard Defined in: [authentication.guard.ts:16](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/authentication/src/lib/authentication.guard.ts#L16) ## Constructors ### new RxapAuthenticationGuard() > **new RxapAuthenticationGuard**(`authentication`, `router`, `deactivated`): [`RxapAuthenticationGuard`](RxapAuthenticationGuard.md) Defined in: [authentication.guard.ts:20](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/authentication/src/lib/authentication.guard.ts#L20) #### Parameters ##### authentication [`RxapAuthenticationService`](RxapAuthenticationService.md) ##### router `Router` ##### deactivated `null` | `boolean` #### Returns [`RxapAuthenticationGuard`](RxapAuthenticationGuard.md) ## Properties ### authentication > **authentication**: [`RxapAuthenticationService`](RxapAuthenticationService.md) Defined in: [authentication.guard.ts:22](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/authentication/src/lib/authentication.guard.ts#L22) *** ### lastUrl > **lastUrl**: `null` \| `string` = `null` Defined in: [authentication.guard.ts:18](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/authentication/src/lib/authentication.guard.ts#L18) *** ### router > **router**: `Router` Defined in: [authentication.guard.ts:24](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/authentication/src/lib/authentication.guard.ts#L24) ## Methods ### canActivate() > **canActivate**(`route`, `state`): `Promise`\<`boolean` \| `UrlTree`\> Defined in: [authentication.guard.ts:31](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/authentication/src/lib/authentication.guard.ts#L31) #### Parameters ##### route `ActivatedRouteSnapshot` ##### state `RouterStateSnapshot` #### Returns `Promise`\<`boolean` \| `UrlTree`\> *** ### canActivateChild() > **canActivateChild**(`childRoute`, `state`): `Promise`\<`boolean` \| `UrlTree`\> Defined in: [authentication.guard.ts:39](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/authentication/src/lib/authentication.guard.ts#L39) #### Parameters ##### childRoute `ActivatedRouteSnapshot` ##### state `RouterStateSnapshot` #### Returns `Promise`\<`boolean` \| `UrlTree`\>