@daffodil/auth 0.59.1 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/driver/in-memory/package.json +1 -1
- package/driver/magento/package.json +1 -1
- package/driver/package.json +1 -1
- package/driver/testing/package.json +1 -1
- package/esm2020/state/auth-state.module.mjs +5 -4
- package/esm2020/state/effects/login.effects.mjs +11 -15
- package/esm2020/state/facades/auth/facade.mjs +5 -5
- package/esm2020/state/facades/login/facade.mjs +5 -5
- package/esm2020/state/facades/register/facade.mjs +5 -5
- package/esm2020/state/facades/reset-password/facade.mjs +5 -5
- package/esm2020/state/reducers/auth/auth-initial-state.mjs +3 -3
- package/esm2020/state/reducers/auth/auth-reducer-state.interface.mjs +1 -1
- package/esm2020/state/reducers/auth/auth.reducer.mjs +6 -16
- package/esm2020/state/reducers/login/login-initial-state.mjs +3 -5
- package/esm2020/state/reducers/login/login-reducer-state.interface.mjs +1 -1
- package/esm2020/state/reducers/login/login.reducer.mjs +5 -15
- package/esm2020/state/reducers/public_api.mjs +2 -1
- package/esm2020/state/reducers/register/register-initial-state.mjs +3 -5
- package/esm2020/state/reducers/register/register-reducer-state.interface.mjs +1 -1
- package/esm2020/state/reducers/register/register.reducer.mjs +5 -15
- package/esm2020/state/reducers/reset-password/initial-state.mjs +3 -3
- package/esm2020/state/reducers/reset-password/reducer.mjs +5 -15
- package/esm2020/state/reducers/reset-password/state.interface.mjs +1 -1
- package/esm2020/state/reducers/token/extra.token.mjs +27 -0
- package/esm2020/state/reducers/token/public_api.mjs +2 -0
- package/esm2020/state/reducers/token/reducers.token.mjs +18 -0
- package/esm2020/state/selectors/auth/auth.selector.mjs +4 -6
- package/esm2020/state/selectors/auth-all.selector.mjs +9 -9
- package/esm2020/state/selectors/login/login.selector.mjs +4 -6
- package/esm2020/state/selectors/public_api.mjs +5 -1
- package/esm2020/state/selectors/register/register.selector.mjs +4 -6
- package/esm2020/state/selectors/reset-password/selector.mjs +4 -6
- package/fesm2015/daffodil-auth-state.mjs +94 -96
- package/fesm2015/daffodil-auth-state.mjs.map +1 -1
- package/fesm2020/daffodil-auth-state.mjs +95 -123
- package/fesm2020/daffodil-auth-state.mjs.map +1 -1
- package/package.json +1 -1
- package/routing/package.json +1 -1
- package/state/effects/login.effects.d.ts +3 -6
- package/state/facades/auth/facade.d.ts +2 -2
- package/state/facades/login/facade.d.ts +2 -2
- package/state/facades/register/facade.d.ts +2 -2
- package/state/facades/reset-password/facade.d.ts +2 -2
- package/state/package.json +1 -1
- package/state/reducers/auth/auth-reducer-state.interface.d.ts +2 -4
- package/state/reducers/login/login-reducer-state.interface.d.ts +2 -5
- package/state/reducers/login/login.reducer.d.ts +1 -1
- package/state/reducers/public_api.d.ts +1 -0
- package/state/reducers/register/register-reducer-state.interface.d.ts +2 -5
- package/state/reducers/register/register.reducer.d.ts +1 -1
- package/state/reducers/reset-password/state.interface.d.ts +2 -4
- package/state/reducers/token/extra.token.d.ts +22 -0
- package/state/reducers/token/public_api.d.ts +1 -0
- package/state/reducers/token/reducers.token.d.ts +10 -0
- package/state/selectors/auth/auth.selector.d.ts +6 -8
- package/state/selectors/login/login.selector.d.ts +5 -7
- package/state/selectors/public_api.d.ts +4 -0
- package/state/selectors/register/register.selector.d.ts +5 -8
- package/state/selectors/reset-password/selector.d.ts +6 -8
- package/state/testing/package.json +1 -1
- package/testing/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { createFeatureSelector, createSelector, select, StoreModule } from '@ngrx/store';
|
|
1
|
+
import { daffOperationInitialState, daffOperationFailed, daffCompleteOperation, daffStartResolution, daffStartMutation, daffOperationStateSelectorFactory, daffComposeReducers } from '@daffodil/core/state';
|
|
3
2
|
import * as i0 from '@angular/core';
|
|
4
|
-
import {
|
|
3
|
+
import { InjectionToken, Injectable, Inject, inject, NgModule } from '@angular/core';
|
|
4
|
+
import * as i1 from '@ngrx/store';
|
|
5
|
+
import { createFeatureSelector, createSelector, select, combineReducers, StoreModule } from '@ngrx/store';
|
|
5
6
|
import * as i1$1 from '@ngrx/effects';
|
|
6
7
|
import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
|
|
7
8
|
import { of, EMPTY, iif, defer } from 'rxjs';
|
|
@@ -271,24 +272,20 @@ class DaffResetPasswordLanding {
|
|
|
271
272
|
}
|
|
272
273
|
}
|
|
273
274
|
|
|
274
|
-
const daffAuthInitialState = {
|
|
275
|
-
loading: false,
|
|
276
|
-
errors: [],
|
|
277
|
-
loggedIn: false,
|
|
278
|
-
};
|
|
275
|
+
const daffAuthInitialState = Object.assign(Object.assign({}, daffOperationInitialState), { loggedIn: false });
|
|
279
276
|
|
|
280
277
|
function daffAuthReducer(state = daffAuthInitialState, action) {
|
|
281
278
|
switch (action.type) {
|
|
282
279
|
case DaffAuthActionTypes.AuthCheckAction:
|
|
283
|
-
return
|
|
280
|
+
return daffStartResolution(state);
|
|
284
281
|
case DaffAuthActionTypes.AuthCheckSuccessAction:
|
|
285
|
-
return Object.assign(Object.assign({}, state), { loggedIn: true
|
|
282
|
+
return Object.assign(Object.assign({}, daffCompleteOperation(state)), { loggedIn: true });
|
|
286
283
|
case DaffAuthActionTypes.AuthCheckFailureAction:
|
|
287
284
|
case DaffAuthActionTypes.AuthGuardLogoutAction:
|
|
288
|
-
return Object.assign(Object.assign({}, state), { loggedIn: false
|
|
285
|
+
return Object.assign(Object.assign({}, daffOperationFailed([action.errorMessage], state)), { loggedIn: false });
|
|
289
286
|
case DaffAuthActionTypes.AuthServerSideAction:
|
|
290
287
|
case DaffAuthActionTypes.AuthStorageFailureAction:
|
|
291
|
-
return
|
|
288
|
+
return daffOperationFailed([action.errorMessage], state);
|
|
292
289
|
case DaffAuthLoginActionTypes.LoginSuccessAction:
|
|
293
290
|
return Object.assign(Object.assign({}, state), { loggedIn: true });
|
|
294
291
|
case DaffAuthRegisterActionTypes.RegisterSuccessAction:
|
|
@@ -301,62 +298,52 @@ function daffAuthReducer(state = daffAuthInitialState, action) {
|
|
|
301
298
|
}
|
|
302
299
|
}
|
|
303
300
|
|
|
304
|
-
const daffAuthLoginInitialState =
|
|
305
|
-
loading: false,
|
|
306
|
-
errors: [],
|
|
307
|
-
};
|
|
301
|
+
const daffAuthLoginInitialState = daffOperationInitialState;
|
|
308
302
|
|
|
309
303
|
function daffAuthLoginReducer(state = daffAuthLoginInitialState, action) {
|
|
310
304
|
switch (action.type) {
|
|
311
305
|
case DaffAuthLoginActionTypes.LoginAction:
|
|
312
306
|
case DaffAuthLoginActionTypes.LogoutAction:
|
|
313
|
-
return
|
|
307
|
+
return daffStartMutation(state);
|
|
314
308
|
case DaffAuthLoginActionTypes.LoginSuccessAction:
|
|
315
309
|
case DaffAuthLoginActionTypes.LogoutSuccessAction:
|
|
316
|
-
return
|
|
310
|
+
return daffCompleteOperation(state);
|
|
317
311
|
case DaffAuthLoginActionTypes.LoginFailureAction:
|
|
318
312
|
case DaffAuthLoginActionTypes.LogoutFailureAction:
|
|
319
|
-
return
|
|
313
|
+
return daffOperationFailed([action.errorMessage], state);
|
|
320
314
|
default:
|
|
321
315
|
return state;
|
|
322
316
|
}
|
|
323
317
|
}
|
|
324
318
|
|
|
325
|
-
const daffAuthRegisterInitialState =
|
|
326
|
-
loading: false,
|
|
327
|
-
errors: [],
|
|
328
|
-
};
|
|
319
|
+
const daffAuthRegisterInitialState = daffOperationInitialState;
|
|
329
320
|
|
|
330
321
|
function daffAuthRegisterReducer(state = daffAuthRegisterInitialState, action) {
|
|
331
322
|
switch (action.type) {
|
|
332
323
|
case DaffAuthRegisterActionTypes.RegisterAction:
|
|
333
|
-
return
|
|
324
|
+
return daffStartMutation(state);
|
|
334
325
|
case DaffAuthRegisterActionTypes.RegisterSuccessAction:
|
|
335
|
-
return
|
|
326
|
+
return daffCompleteOperation(state);
|
|
336
327
|
case DaffAuthRegisterActionTypes.RegisterFailureAction:
|
|
337
|
-
return
|
|
328
|
+
return daffOperationFailed([action.errorMessage], state);
|
|
338
329
|
default:
|
|
339
330
|
return state;
|
|
340
331
|
}
|
|
341
332
|
}
|
|
342
333
|
|
|
343
|
-
const daffAuthResetPasswordInitialState = {
|
|
344
|
-
loading: false,
|
|
345
|
-
errors: [],
|
|
346
|
-
token: null,
|
|
347
|
-
};
|
|
334
|
+
const daffAuthResetPasswordInitialState = Object.assign(Object.assign({}, daffOperationInitialState), { token: null });
|
|
348
335
|
|
|
349
336
|
function daffAuthResetPasswordReducer(state = daffAuthResetPasswordInitialState, action) {
|
|
350
337
|
switch (action.type) {
|
|
351
338
|
case DaffAuthResetPasswordActionTypes.ResetPasswordAction:
|
|
352
339
|
case DaffAuthResetPasswordActionTypes.SendResetEmailAction:
|
|
353
|
-
return
|
|
340
|
+
return daffStartMutation(state);
|
|
354
341
|
case DaffAuthResetPasswordActionTypes.ResetPasswordSuccessAction:
|
|
355
342
|
case DaffAuthResetPasswordActionTypes.SendResetEmailSuccessAction:
|
|
356
|
-
return
|
|
343
|
+
return daffCompleteOperation(state);
|
|
357
344
|
case DaffAuthResetPasswordActionTypes.ResetPasswordFailureAction:
|
|
358
345
|
case DaffAuthResetPasswordActionTypes.SendResetEmailFailureAction:
|
|
359
|
-
return
|
|
346
|
+
return daffOperationFailed([action.errorMessage], state);
|
|
360
347
|
case DaffAuthResetPasswordActionTypes.ResetPasswordLandingAction:
|
|
361
348
|
return Object.assign(Object.assign({}, state), { token: action.token });
|
|
362
349
|
default:
|
|
@@ -364,6 +351,32 @@ function daffAuthResetPasswordReducer(state = daffAuthResetPasswordInitialState,
|
|
|
364
351
|
}
|
|
365
352
|
}
|
|
366
353
|
|
|
354
|
+
/**
|
|
355
|
+
* A token to hold the injectable extra reducers.
|
|
356
|
+
*
|
|
357
|
+
* Prefer using {@link daffAuthProvideExtraReducers}.
|
|
358
|
+
*/
|
|
359
|
+
const DAFF_AUTH_EXTRA_REDUCERS = new InjectionToken('DAFF_AUTH_EXTRA_REDUCERS', { factory: () => [] });
|
|
360
|
+
/**
|
|
361
|
+
* Provides additional reducers that run after the standard Daffodil auth reducers.
|
|
362
|
+
*
|
|
363
|
+
* ```ts
|
|
364
|
+
* providers: [
|
|
365
|
+
* ...daffAuthProvideExtraReducers(
|
|
366
|
+
* myReducer1,
|
|
367
|
+
* myReducer2
|
|
368
|
+
* )
|
|
369
|
+
* ]
|
|
370
|
+
* ```
|
|
371
|
+
*/
|
|
372
|
+
function daffAuthProvideExtraReducers(...reducers) {
|
|
373
|
+
return reducers.map(reducer => ({
|
|
374
|
+
provide: DAFF_AUTH_EXTRA_REDUCERS,
|
|
375
|
+
useValue: reducer,
|
|
376
|
+
multi: true,
|
|
377
|
+
}));
|
|
378
|
+
}
|
|
379
|
+
|
|
367
380
|
const DAFF_AUTH_STORE_FEATURE_KEY = 'daffAuth';
|
|
368
381
|
|
|
369
382
|
const daffAuthReducers = {
|
|
@@ -383,71 +396,47 @@ const getDaffAuthFeatureStateSelector = (() => {
|
|
|
383
396
|
|
|
384
397
|
const createAuthSelectors = () => {
|
|
385
398
|
const selectAuthState = createSelector(getDaffAuthFeatureStateSelector(), state => state.auth);
|
|
386
|
-
const selectAuthLoading = createSelector(selectAuthState, state => state.loading);
|
|
387
|
-
const selectAuthErrors = createSelector(selectAuthState, state => state.errors);
|
|
388
399
|
const selectAuthLoggedIn = createSelector(selectAuthState, state => state.loggedIn);
|
|
389
|
-
return {
|
|
390
|
-
|
|
391
|
-
selectAuthLoading,
|
|
392
|
-
selectAuthErrors,
|
|
393
|
-
selectAuthLoggedIn,
|
|
394
|
-
};
|
|
400
|
+
return Object.assign(Object.assign({}, daffOperationStateSelectorFactory(selectAuthState)), { selectAuthState,
|
|
401
|
+
selectAuthLoggedIn });
|
|
395
402
|
};
|
|
396
|
-
const
|
|
403
|
+
const daffAuthSelectorFactory = (() => {
|
|
397
404
|
let cache;
|
|
398
405
|
return () => cache = cache || createAuthSelectors();
|
|
399
406
|
})();
|
|
400
407
|
|
|
401
408
|
const createLoginSelectors = () => {
|
|
402
409
|
const selectAuthLoginState = createSelector(getDaffAuthFeatureStateSelector(), state => state.login);
|
|
403
|
-
|
|
404
|
-
const selectAuthLoginErrors = createSelector(selectAuthLoginState, state => state.errors);
|
|
405
|
-
return {
|
|
406
|
-
selectAuthLoginState,
|
|
407
|
-
selectAuthLoginLoading,
|
|
408
|
-
selectAuthLoginErrors,
|
|
409
|
-
};
|
|
410
|
+
return Object.assign(Object.assign({}, daffOperationStateSelectorFactory(selectAuthLoginState)), { selectAuthLoginState });
|
|
410
411
|
};
|
|
411
|
-
const
|
|
412
|
+
const daffAuthLoginSelectorFactory = (() => {
|
|
412
413
|
let cache;
|
|
413
414
|
return () => cache = cache || createLoginSelectors();
|
|
414
415
|
})();
|
|
415
416
|
|
|
416
417
|
const createRegisterSelectors = () => {
|
|
417
418
|
const selectAuthRegisterState = createSelector(getDaffAuthFeatureStateSelector(), state => state.register);
|
|
418
|
-
|
|
419
|
-
const selectAuthRegisterErrors = createSelector(selectAuthRegisterState, state => state.errors);
|
|
420
|
-
return {
|
|
421
|
-
selectAuthRegisterState,
|
|
422
|
-
selectAuthRegisterLoading,
|
|
423
|
-
selectAuthRegisterErrors,
|
|
424
|
-
};
|
|
419
|
+
return Object.assign(Object.assign({}, daffOperationStateSelectorFactory(selectAuthRegisterState)), { selectAuthRegisterState });
|
|
425
420
|
};
|
|
426
|
-
const
|
|
421
|
+
const daffAuthRegisterSelectorFactory = (() => {
|
|
427
422
|
let cache;
|
|
428
423
|
return () => cache = cache || createRegisterSelectors();
|
|
429
424
|
})();
|
|
430
425
|
|
|
431
426
|
const createResetPasswordSelectors = () => {
|
|
432
427
|
const selectAuthResetPasswordState = createSelector(getDaffAuthFeatureStateSelector(), state => state.resetPassword);
|
|
433
|
-
const selectAuthResetPasswordLoading = createSelector(selectAuthResetPasswordState, state => state.loading);
|
|
434
|
-
const selectAuthResetPasswordErrors = createSelector(selectAuthResetPasswordState, state => state.errors);
|
|
435
428
|
const selectAuthResetPasswordToken = createSelector(selectAuthResetPasswordState, state => state.token);
|
|
436
|
-
return {
|
|
437
|
-
|
|
438
|
-
selectAuthResetPasswordLoading,
|
|
439
|
-
selectAuthResetPasswordErrors,
|
|
440
|
-
selectAuthResetPasswordToken,
|
|
441
|
-
};
|
|
429
|
+
return Object.assign(Object.assign({}, daffOperationStateSelectorFactory(selectAuthResetPasswordState)), { selectAuthResetPasswordState,
|
|
430
|
+
selectAuthResetPasswordToken });
|
|
442
431
|
};
|
|
443
|
-
const
|
|
432
|
+
const daffAuthResetPasswordSelectorFactory = (() => {
|
|
444
433
|
let cache;
|
|
445
434
|
return () => cache = cache || createResetPasswordSelectors();
|
|
446
435
|
})();
|
|
447
436
|
|
|
448
437
|
const getDaffAuthSelectors = (() => {
|
|
449
438
|
let cache;
|
|
450
|
-
return () => cache = cache || Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},
|
|
439
|
+
return () => cache = cache || Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, daffAuthSelectorFactory()), daffAuthLoginSelectorFactory()), daffAuthRegisterSelectorFactory()), daffAuthResetPasswordSelectorFactory()), { selectAuthFeatureState: getDaffAuthFeatureStateSelector() });
|
|
451
440
|
})();
|
|
452
441
|
|
|
453
442
|
/**
|
|
@@ -456,9 +445,9 @@ const getDaffAuthSelectors = (() => {
|
|
|
456
445
|
class DaffAuthFacade {
|
|
457
446
|
constructor(store) {
|
|
458
447
|
this.store = store;
|
|
459
|
-
const {
|
|
460
|
-
this.loading$ = this.store.pipe(select(
|
|
461
|
-
this.errors$ = this.store.pipe(select(
|
|
448
|
+
const { selectLoading, selectErrors, selectAuthLoggedIn, } = daffAuthSelectorFactory();
|
|
449
|
+
this.loading$ = this.store.pipe(select(selectLoading));
|
|
450
|
+
this.errors$ = this.store.pipe(select(selectErrors));
|
|
462
451
|
this.loggedIn$ = this.store.pipe(select(selectAuthLoggedIn));
|
|
463
452
|
}
|
|
464
453
|
dispatch(action) {
|
|
@@ -480,9 +469,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
480
469
|
class DaffAuthLoginFacade {
|
|
481
470
|
constructor(store) {
|
|
482
471
|
this.store = store;
|
|
483
|
-
const {
|
|
484
|
-
this.loading$ = this.store.pipe(select(
|
|
485
|
-
this.errors$ = this.store.pipe(select(
|
|
472
|
+
const { selectLoading, selectErrors, } = daffAuthLoginSelectorFactory();
|
|
473
|
+
this.loading$ = this.store.pipe(select(selectLoading));
|
|
474
|
+
this.errors$ = this.store.pipe(select(selectErrors));
|
|
486
475
|
}
|
|
487
476
|
dispatch(action) {
|
|
488
477
|
this.store.dispatch(action);
|
|
@@ -503,9 +492,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
503
492
|
class DaffAuthRegisterFacade {
|
|
504
493
|
constructor(store) {
|
|
505
494
|
this.store = store;
|
|
506
|
-
const {
|
|
507
|
-
this.loading$ = this.store.pipe(select(
|
|
508
|
-
this.errors$ = this.store.pipe(select(
|
|
495
|
+
const { selectLoading, selectErrors, } = daffAuthRegisterSelectorFactory();
|
|
496
|
+
this.loading$ = this.store.pipe(select(selectLoading));
|
|
497
|
+
this.errors$ = this.store.pipe(select(selectErrors));
|
|
509
498
|
}
|
|
510
499
|
dispatch(action) {
|
|
511
500
|
this.store.dispatch(action);
|
|
@@ -526,10 +515,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
526
515
|
class DaffAuthResetPasswordFacade {
|
|
527
516
|
constructor(store) {
|
|
528
517
|
this.store = store;
|
|
529
|
-
const {
|
|
518
|
+
const { selectLoading, selectErrors, selectAuthResetPasswordToken, } = daffAuthResetPasswordSelectorFactory();
|
|
530
519
|
this.token$ = this.store.pipe(select(selectAuthResetPasswordToken));
|
|
531
|
-
this.loading$ = this.store.pipe(select(
|
|
532
|
-
this.errors$ = this.store.pipe(select(
|
|
520
|
+
this.loading$ = this.store.pipe(select(selectLoading));
|
|
521
|
+
this.errors$ = this.store.pipe(select(selectErrors));
|
|
533
522
|
}
|
|
534
523
|
dispatch(action) {
|
|
535
524
|
this.store.dispatch(action);
|
|
@@ -614,30 +603,26 @@ class DaffAuthLoginEffects {
|
|
|
614
603
|
this.loginDriver = loginDriver;
|
|
615
604
|
this.errorMatcher = errorMatcher;
|
|
616
605
|
this.storage = storage;
|
|
617
|
-
this.login$ = createEffect(() => this.actions$.pipe(ofType(DaffAuthLoginActionTypes.LoginAction), switchMap((action) => this.loginDriver.login(action.loginInfo)
|
|
618
|
-
|
|
619
|
-
this.removeAuthToken$ = createEffect(() => this.actions$.pipe(ofType(DaffAuthLoginActionTypes.LogoutSuccessAction), tap(() => {
|
|
620
|
-
this.storage.removeAuthToken();
|
|
621
|
-
}), switchMap(() => EMPTY), catchError((error) => {
|
|
606
|
+
this.login$ = createEffect(() => this.actions$.pipe(ofType(DaffAuthLoginActionTypes.LoginAction), switchMap((action) => this.loginDriver.login(action.loginInfo)
|
|
607
|
+
.pipe(map((resp) => new DaffAuthLoginSuccess(resp)), tap((success) => this.storage.setAuthToken(success.auth.token)), catchError((error) => {
|
|
622
608
|
switch (true) {
|
|
623
609
|
case error instanceof DaffServerSideStorageError:
|
|
624
610
|
return of(new DaffAuthServerSide(this.errorMatcher(error)));
|
|
625
611
|
case error instanceof DaffStorageServiceError:
|
|
626
612
|
default:
|
|
627
|
-
return of(new
|
|
613
|
+
return of(new DaffAuthLoginFailure(this.errorMatcher(error)));
|
|
628
614
|
}
|
|
629
|
-
}))
|
|
630
|
-
this.
|
|
631
|
-
this.storage.setAuthToken(action.auth.token);
|
|
632
|
-
}), switchMap(() => EMPTY), catchError((error) => {
|
|
615
|
+
})))));
|
|
616
|
+
this.logout$ = createEffect(() => this.actions$.pipe(ofType(DaffAuthLoginActionTypes.LogoutAction), switchMap((action) => this.loginDriver.logout().pipe(map(() => new DaffAuthLogoutSuccess()), tap(() => this.storage.removeAuthToken()), catchError((error) => {
|
|
633
617
|
switch (true) {
|
|
634
618
|
case error instanceof DaffServerSideStorageError:
|
|
635
619
|
return of(new DaffAuthServerSide(this.errorMatcher(error)));
|
|
636
620
|
case error instanceof DaffStorageServiceError:
|
|
637
|
-
default:
|
|
638
621
|
return of(new DaffAuthStorageFailure(this.errorMatcher(error)));
|
|
622
|
+
default:
|
|
623
|
+
return of(new DaffAuthLogoutFailure(this.errorMatcher(error)));
|
|
639
624
|
}
|
|
640
|
-
}))
|
|
625
|
+
})))));
|
|
641
626
|
}
|
|
642
627
|
}
|
|
643
628
|
/** @nocollapse */ DaffAuthLoginEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthLoginEffects, deps: [{ token: i1$1.Actions }, { token: DaffLoginDriver }, { token: DAFF_AUTH_ERROR_MATCHER }, { token: i2$1.DaffAuthStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -719,6 +704,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
719
704
|
}] }, { type: i2$1.DaffAuthStorageService }];
|
|
720
705
|
} });
|
|
721
706
|
|
|
707
|
+
/**
|
|
708
|
+
* An internal token to hold the Daffodil auth reducers.
|
|
709
|
+
* Includes the extra and standard reducers.
|
|
710
|
+
*
|
|
711
|
+
* @docs-private
|
|
712
|
+
*/
|
|
713
|
+
const DAFF_AUTH_REDUCERS = new InjectionToken('DAFF_AUTH_REDUCERS', {
|
|
714
|
+
factory: () => daffComposeReducers([
|
|
715
|
+
combineReducers(daffAuthReducers),
|
|
716
|
+
...inject(DAFF_AUTH_EXTRA_REDUCERS),
|
|
717
|
+
]),
|
|
718
|
+
});
|
|
719
|
+
|
|
722
720
|
class DaffAuthStateModule {
|
|
723
721
|
static withConfig(config = {}) {
|
|
724
722
|
return {
|
|
@@ -732,7 +730,7 @@ class DaffAuthStateModule {
|
|
|
732
730
|
/** @nocollapse */ DaffAuthStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
733
731
|
/** @nocollapse */ DaffAuthStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthStateModule, imports: [i1.StoreFeatureModule, i1$1.EffectsFeatureModule] });
|
|
734
732
|
/** @nocollapse */ DaffAuthStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthStateModule, imports: [[
|
|
735
|
-
StoreModule.forFeature(DAFF_AUTH_STORE_FEATURE_KEY,
|
|
733
|
+
StoreModule.forFeature(DAFF_AUTH_STORE_FEATURE_KEY, DAFF_AUTH_REDUCERS),
|
|
736
734
|
EffectsModule.forFeature([
|
|
737
735
|
DaffAuthEffects,
|
|
738
736
|
DaffAuthLoginEffects,
|
|
@@ -744,7 +742,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
744
742
|
type: NgModule,
|
|
745
743
|
args: [{
|
|
746
744
|
imports: [
|
|
747
|
-
StoreModule.forFeature(DAFF_AUTH_STORE_FEATURE_KEY,
|
|
745
|
+
StoreModule.forFeature(DAFF_AUTH_STORE_FEATURE_KEY, DAFF_AUTH_REDUCERS),
|
|
748
746
|
EffectsModule.forFeature([
|
|
749
747
|
DaffAuthEffects,
|
|
750
748
|
DaffAuthLoginEffects,
|
|
@@ -759,5 +757,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
759
757
|
* Generated bundle index. Do not edit.
|
|
760
758
|
*/
|
|
761
759
|
|
|
762
|
-
export { DAFF_AUTH_STATE_CONFIG, DAFF_AUTH_STORE_FEATURE_KEY, DaffAuthActionTypes, DaffAuthCheck, DaffAuthCheckFailure, DaffAuthCheckSuccess, DaffAuthFacade, DaffAuthGuardLogout, DaffAuthLogin, DaffAuthLoginActionTypes, DaffAuthLoginFacade, DaffAuthLoginFailure, DaffAuthLoginSuccess, DaffAuthLogout, DaffAuthLogoutFailure, DaffAuthLogoutSuccess, DaffAuthRegister, DaffAuthRegisterActionTypes, DaffAuthRegisterFacade, DaffAuthRegisterFailure, DaffAuthRegisterSuccess, DaffAuthResetPasswordActionTypes, DaffAuthResetPasswordFacade, DaffAuthServerSide, DaffAuthStateModule, DaffAuthStorageFailure, DaffResetPassword, DaffResetPasswordFailure, DaffResetPasswordLanding, DaffResetPasswordSuccess, DaffSendResetEmail, DaffSendResetEmailFailure, DaffSendResetEmailSuccess, daffAuthInitialState, daffAuthLoginInitialState, daffAuthLoginReducer, daffAuthReducer, daffAuthReducers, daffAuthRegisterInitialState, daffAuthRegisterReducer, daffAuthResetPasswordInitialState, daffAuthResetPasswordReducer, daffAuthStateDefaultConfig, getDaffAuthSelectors, provideDaffAuthStateConfig };
|
|
760
|
+
export { DAFF_AUTH_EXTRA_REDUCERS, DAFF_AUTH_STATE_CONFIG, DAFF_AUTH_STORE_FEATURE_KEY, DaffAuthActionTypes, DaffAuthCheck, DaffAuthCheckFailure, DaffAuthCheckSuccess, DaffAuthFacade, DaffAuthGuardLogout, DaffAuthLogin, DaffAuthLoginActionTypes, DaffAuthLoginFacade, DaffAuthLoginFailure, DaffAuthLoginSuccess, DaffAuthLogout, DaffAuthLogoutFailure, DaffAuthLogoutSuccess, DaffAuthRegister, DaffAuthRegisterActionTypes, DaffAuthRegisterFacade, DaffAuthRegisterFailure, DaffAuthRegisterSuccess, DaffAuthResetPasswordActionTypes, DaffAuthResetPasswordFacade, DaffAuthServerSide, DaffAuthStateModule, DaffAuthStorageFailure, DaffResetPassword, DaffResetPasswordFailure, DaffResetPasswordLanding, DaffResetPasswordSuccess, DaffSendResetEmail, DaffSendResetEmailFailure, DaffSendResetEmailSuccess, daffAuthInitialState, daffAuthLoginInitialState, daffAuthLoginReducer, daffAuthLoginSelectorFactory, daffAuthProvideExtraReducers, daffAuthReducer, daffAuthReducers, daffAuthRegisterInitialState, daffAuthRegisterReducer, daffAuthRegisterSelectorFactory, daffAuthResetPasswordInitialState, daffAuthResetPasswordReducer, daffAuthResetPasswordSelectorFactory, daffAuthSelectorFactory, daffAuthStateDefaultConfig, getDaffAuthSelectors, provideDaffAuthStateConfig };
|
|
763
761
|
//# sourceMappingURL=daffodil-auth-state.mjs.map
|