UNPKG

17.6 kBJavaScriptView Raw
1import { Injector, NgModule } from '@angular/core';
2import { CommonModule } from '@angular/common';
3import { RouterModule } from '@angular/router';
4import { FormsModule } from '@angular/forms';
5import { NbAlertModule, NbButtonModule, NbCardModule, NbCheckboxModule, NbIconModule, NbInputModule, NbLayoutModule, } from '@nebular/theme';
6import { NbAuthService } from './services/auth.service';
7import { NbAuthSimpleToken } from './services/token/token';
8import { NbTokenLocalStorage, NbTokenStorage } from './services/token/token-storage';
9import { NbTokenService } from './services/token/token.service';
10import { NbAuthTokenParceler, NB_AUTH_FALLBACK_TOKEN } from './services/token/token-parceler';
11import { NbDummyAuthStrategy } from './strategies/dummy/dummy-strategy';
12import { NbOAuth2AuthStrategy } from './strategies/oauth2/oauth2-strategy';
13import { NbPasswordAuthStrategy } from './strategies/password/password-strategy';
14import { defaultAuthOptions, NB_AUTH_INTERCEPTOR_HEADER, NB_AUTH_OPTIONS, NB_AUTH_STRATEGIES, NB_AUTH_TOKEN_INTERCEPTOR_FILTER, NB_AUTH_TOKENS, NB_AUTH_USER_OPTIONS, } from './auth.options';
15import { NbAuthComponent } from './components/auth.component';
16import { NbAuthBlockComponent } from './components/auth-block/auth-block.component';
17import { NbLoginComponent } from './components/login/login.component';
18import { NbRegisterComponent } from './components/register/register.component';
19import { NbLogoutComponent } from './components/logout/logout.component';
20import { NbRequestPasswordComponent } from './components/request-password/request-password.component';
21import { NbResetPasswordComponent } from './components/reset-password/reset-password.component';
22import { deepExtend } from './helpers';
23import * as i0 from "@angular/core";
24export function nbStrategiesFactory(options, injector) {
25 const strategies = [];
26 options.strategies
27 .forEach(([strategyClass, strategyOptions]) => {
28 const strategy = injector.get(strategyClass);
29 strategy.setOptions(strategyOptions);
30 strategies.push(strategy);
31 });
32 return strategies;
33}
34export function nbTokensFactory(strategies) {
35 const tokens = [];
36 strategies
37 .forEach((strategy) => {
38 tokens.push(strategy.getOption('token.class'));
39 });
40 return tokens;
41}
42export function nbOptionsFactory(options) {
43 return deepExtend(defaultAuthOptions, options);
44}
45export function nbNoOpInterceptorFilter(req) {
46 return true;
47}
48export class NbAuthModule {
49 static forRoot(nbAuthOptions) {
50 return {
51 ngModule: NbAuthModule,
52 providers: [
53 { provide: NB_AUTH_USER_OPTIONS, useValue: nbAuthOptions },
54 { provide: NB_AUTH_OPTIONS, useFactory: nbOptionsFactory, deps: [NB_AUTH_USER_OPTIONS] },
55 { provide: NB_AUTH_STRATEGIES, useFactory: nbStrategiesFactory, deps: [NB_AUTH_OPTIONS, Injector] },
56 { provide: NB_AUTH_TOKENS, useFactory: nbTokensFactory, deps: [NB_AUTH_STRATEGIES] },
57 { provide: NB_AUTH_FALLBACK_TOKEN, useValue: NbAuthSimpleToken },
58 { provide: NB_AUTH_INTERCEPTOR_HEADER, useValue: 'Authorization' },
59 { provide: NB_AUTH_TOKEN_INTERCEPTOR_FILTER, useValue: nbNoOpInterceptorFilter },
60 { provide: NbTokenStorage, useClass: NbTokenLocalStorage },
61 NbAuthTokenParceler,
62 NbAuthService,
63 NbTokenService,
64 NbDummyAuthStrategy,
65 NbPasswordAuthStrategy,
66 NbOAuth2AuthStrategy,
67 ],
68 };
69 }
70 static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: NbAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
71 static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0", ngImport: i0, type: NbAuthModule, declarations: [NbAuthComponent,
72 NbAuthBlockComponent,
73 NbLoginComponent,
74 NbRegisterComponent,
75 NbRequestPasswordComponent,
76 NbResetPasswordComponent,
77 NbLogoutComponent], imports: [CommonModule,
78 NbLayoutModule,
79 NbCardModule,
80 NbCheckboxModule,
81 NbAlertModule,
82 NbInputModule,
83 NbButtonModule,
84 RouterModule,
85 FormsModule,
86 NbIconModule], exports: [NbAuthComponent,
87 NbAuthBlockComponent,
88 NbLoginComponent,
89 NbRegisterComponent,
90 NbRequestPasswordComponent,
91 NbResetPasswordComponent,
92 NbLogoutComponent] }); }
93 static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: NbAuthModule, imports: [CommonModule,
94 NbLayoutModule,
95 NbCardModule,
96 NbCheckboxModule,
97 NbAlertModule,
98 NbInputModule,
99 NbButtonModule,
100 RouterModule,
101 FormsModule,
102 NbIconModule] }); }
103}
104i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: NbAuthModule, decorators: [{
105 type: NgModule,
106 args: [{
107 imports: [
108 CommonModule,
109 NbLayoutModule,
110 NbCardModule,
111 NbCheckboxModule,
112 NbAlertModule,
113 NbInputModule,
114 NbButtonModule,
115 RouterModule,
116 FormsModule,
117 NbIconModule,
118 ],
119 declarations: [
120 NbAuthComponent,
121 NbAuthBlockComponent,
122 NbLoginComponent,
123 NbRegisterComponent,
124 NbRequestPasswordComponent,
125 NbResetPasswordComponent,
126 NbLogoutComponent,
127 ],
128 exports: [
129 NbAuthComponent,
130 NbAuthBlockComponent,
131 NbLoginComponent,
132 NbRegisterComponent,
133 NbRequestPasswordComponent,
134 NbResetPasswordComponent,
135 NbLogoutComponent,
136 ],
137 }]
138 }] });
139//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aC5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvZnJhbWV3b3JrL2F1dGgvYXV0aC5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBdUIsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3hFLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMvQyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLEN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