@daffodil/auth 0.48.1 → 0.49.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/esm2020/driver/magento/apollo-bearer-token-link-generator.mjs +6 -2
- package/esm2020/state/actions/auth.actions.mjs +12 -1
- package/esm2020/state/auth-state.module.mjs +10 -4
- package/esm2020/state/config/default.mjs +3 -1
- package/esm2020/state/config/type.mjs +1 -1
- package/esm2020/state/effects/auth.effects.mjs +33 -12
- package/esm2020/state/effects/login.effects.mjs +24 -6
- package/esm2020/state/effects/redirect.effects.mjs +35 -0
- package/esm2020/state/effects/register.effects.mjs +13 -3
- package/esm2020/state/effects/reset-password.effects.mjs +13 -3
- package/esm2020/state/reducers/auth/auth.reducer.mjs +3 -1
- package/fesm2015/daffodil-auth-driver-magento.mjs +5 -1
- package/fesm2015/daffodil-auth-driver-magento.mjs.map +1 -1
- package/fesm2015/daffodil-auth-state.mjs +119 -18
- package/fesm2015/daffodil-auth-state.mjs.map +1 -1
- package/fesm2020/daffodil-auth-driver-magento.mjs +5 -1
- package/fesm2020/daffodil-auth-driver-magento.mjs.map +1 -1
- package/fesm2020/daffodil-auth-state.mjs +120 -18
- package/fesm2020/daffodil-auth-state.mjs.map +1 -1
- package/package.json +3 -3
- package/state/actions/auth.actions.d.ts +7 -1
- package/state/auth-state.module.d.ts +1 -1
- package/state/config/type.d.ts +10 -0
- package/state/effects/auth.effects.d.ts +5 -4
- package/state/effects/login.effects.d.ts +5 -4
- package/state/effects/redirect.effects.d.ts +17 -0
- package/state/effects/reset-password.effects.d.ts +2 -2
|
@@ -4,6 +4,7 @@ export declare enum DaffAuthActionTypes {
|
|
|
4
4
|
AuthGuardCheckAction = "[@daffodil/auth] Auth Guard Check Action",
|
|
5
5
|
AuthGuardCheckCompletionAction = "[@daffodil/auth] Auth Guard Check Completion Action",
|
|
6
6
|
AuthStorageFailureAction = "[@daffodil/auth] Auth Storage Failure Action",
|
|
7
|
+
AuthServerSideAction = "[@daffodil/auth] Auth Server Side Action",
|
|
7
8
|
AuthCheckAction = "[@daffodil/auth] Auth Check Action",
|
|
8
9
|
AuthCheckSuccessAction = "[@daffodil/auth] Auth Check Success Action",
|
|
9
10
|
AuthCheckFailureAction = "[@daffodil/auth] Auth Check Failure Action",
|
|
@@ -28,6 +29,11 @@ export declare class DaffAuthStorageFailure implements Action {
|
|
|
28
29
|
readonly type = DaffAuthActionTypes.AuthStorageFailureAction;
|
|
29
30
|
constructor(errorMessage: DaffStateError);
|
|
30
31
|
}
|
|
32
|
+
export declare class DaffAuthServerSide implements Action {
|
|
33
|
+
errorMessage: DaffStateError;
|
|
34
|
+
readonly type = DaffAuthActionTypes.AuthServerSideAction;
|
|
35
|
+
constructor(errorMessage: DaffStateError);
|
|
36
|
+
}
|
|
31
37
|
/**
|
|
32
38
|
* An action triggered to initialize an auth check request.
|
|
33
39
|
*/
|
|
@@ -59,4 +65,4 @@ export declare class DaffAuthCheckFailure implements Action {
|
|
|
59
65
|
export declare class DaffAuthComplete implements Action {
|
|
60
66
|
readonly type = DaffAuthActionTypes.AuthCompleteAction;
|
|
61
67
|
}
|
|
62
|
-
export declare type DaffAuthActions = DaffAuthGuardCheckCompletion | DaffAuthGuardCheck | DaffAuthStorageFailure | DaffAuthCheck | DaffAuthCheckSuccess | DaffAuthCheckFailure | DaffAuthComplete;
|
|
68
|
+
export declare type DaffAuthActions = DaffAuthGuardCheckCompletion | DaffAuthGuardCheck | DaffAuthStorageFailure | DaffAuthServerSide | DaffAuthCheck | DaffAuthCheckSuccess | DaffAuthCheckFailure | DaffAuthComplete;
|
|
@@ -4,7 +4,7 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
import * as i1 from "@ngrx/store";
|
|
5
5
|
import * as i2 from "@ngrx/effects";
|
|
6
6
|
export declare class DaffAuthStateModule {
|
|
7
|
-
static withConfig(config
|
|
7
|
+
static withConfig(config?: Partial<DaffAuthStateConfig>): ModuleWithProviders<DaffAuthStateModule>;
|
|
8
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthStateModule, never>;
|
|
9
9
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthStateModule, never, [typeof i1.StoreFeatureModule, typeof i2.EffectsFeatureModule], never>;
|
|
10
10
|
static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthStateModule>;
|
package/state/config/type.d.ts
CHANGED
|
@@ -4,4 +4,14 @@ export interface DaffAuthStateConfig {
|
|
|
4
4
|
* Defaults to twenty minutes.
|
|
5
5
|
*/
|
|
6
6
|
checkInterval: number;
|
|
7
|
+
/**
|
|
8
|
+
* The path to which the user will be redirected when they are logged in and the auth token is stored.
|
|
9
|
+
* Defaults to `'/'`.
|
|
10
|
+
*/
|
|
11
|
+
authCompleteRedirectPath: string;
|
|
12
|
+
/**
|
|
13
|
+
* The path to which the user will be redirected when they are logged out.
|
|
14
|
+
* Defaults to `'/'`.
|
|
15
|
+
*/
|
|
16
|
+
logoutRedirectPath: string;
|
|
7
17
|
}
|
|
@@ -3,7 +3,7 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { DaffAuthStorageService } from '@daffodil/auth';
|
|
4
4
|
import { DaffAuthServiceInterface } from '@daffodil/auth/driver';
|
|
5
5
|
import { ErrorTransformer } from '@daffodil/core/state';
|
|
6
|
-
import { DaffAuthCheckSuccess, DaffAuthCheckFailure, DaffAuthCheck, DaffAuthGuardCheckCompletion } from '../actions/public_api';
|
|
6
|
+
import { DaffAuthCheckSuccess, DaffAuthCheckFailure, DaffAuthCheck, DaffAuthGuardCheckCompletion, DaffAuthStorageFailure, DaffAuthServerSide } from '../actions/public_api';
|
|
7
7
|
import { DaffAuthStateConfig } from '../config/public_api';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
export declare class DaffAuthEffects {
|
|
@@ -13,9 +13,10 @@ export declare class DaffAuthEffects {
|
|
|
13
13
|
private storage;
|
|
14
14
|
private config;
|
|
15
15
|
constructor(actions$: Actions, authDriver: DaffAuthServiceInterface, errorMatcher: ErrorTransformer, storage: DaffAuthStorageService, config: DaffAuthStateConfig);
|
|
16
|
-
check$: Observable<DaffAuthCheckSuccess | DaffAuthCheckFailure
|
|
17
|
-
guardCheck$: Observable<DaffAuthGuardCheckCompletion
|
|
18
|
-
|
|
16
|
+
check$: Observable<DaffAuthCheckSuccess | DaffAuthCheckFailure> & import("@ngrx/effects").CreateEffectMetadata;
|
|
17
|
+
guardCheck$: Observable<DaffAuthGuardCheckCompletion> & import("@ngrx/effects").CreateEffectMetadata;
|
|
18
|
+
removeAuthToken$: Observable<DaffAuthStorageFailure | DaffAuthServerSide> & import("@ngrx/effects").CreateEffectMetadata;
|
|
19
|
+
authCheckInterval$: Observable<DaffAuthStorageFailure | DaffAuthServerSide | DaffAuthCheck> & import("@ngrx/effects").CreateEffectMetadata;
|
|
19
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthEffects, never>;
|
|
20
21
|
static ɵprov: i0.ɵɵInjectableDeclaration<DaffAuthEffects>;
|
|
21
22
|
}
|
|
@@ -3,7 +3,7 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { DaffLoginInfo, DaffAuthToken, DaffAuthStorageService } from '@daffodil/auth';
|
|
4
4
|
import { DaffLoginServiceInterface } from '@daffodil/auth/driver';
|
|
5
5
|
import { ErrorTransformer } from '@daffodil/core/state';
|
|
6
|
-
import { DaffAuthLoginSuccess, DaffAuthLoginFailure, DaffAuthLogoutSuccess, DaffAuthLogoutFailure, DaffAuthStorageFailure, DaffAuthComplete } from '../actions/public_api';
|
|
6
|
+
import { DaffAuthLoginSuccess, DaffAuthLoginFailure, DaffAuthLogoutSuccess, DaffAuthLogoutFailure, DaffAuthStorageFailure, DaffAuthComplete, DaffAuthServerSide } from '../actions/public_api';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
export declare class DaffAuthLoginEffects<T extends DaffLoginInfo = DaffLoginInfo, U extends DaffAuthToken = DaffAuthToken> {
|
|
9
9
|
private actions$;
|
|
@@ -11,9 +11,10 @@ export declare class DaffAuthLoginEffects<T extends DaffLoginInfo = DaffLoginInf
|
|
|
11
11
|
private errorMatcher;
|
|
12
12
|
private storage;
|
|
13
13
|
constructor(actions$: Actions, loginDriver: DaffLoginServiceInterface<T, U>, errorMatcher: ErrorTransformer, storage: DaffAuthStorageService);
|
|
14
|
-
login$: Observable<DaffAuthLoginSuccess<U
|
|
15
|
-
logout$: Observable<DaffAuthLogoutSuccess | DaffAuthLogoutFailure
|
|
16
|
-
|
|
14
|
+
login$: Observable<DaffAuthLoginFailure | DaffAuthLoginSuccess<U>> & import("@ngrx/effects").CreateEffectMetadata;
|
|
15
|
+
logout$: Observable<DaffAuthLogoutSuccess | DaffAuthLogoutFailure> & import("@ngrx/effects").CreateEffectMetadata;
|
|
16
|
+
removeAuthToken$: Observable<DaffAuthStorageFailure | DaffAuthServerSide> & import("@ngrx/effects").CreateEffectMetadata;
|
|
17
|
+
storeAuthToken$: Observable<DaffAuthStorageFailure | DaffAuthServerSide | DaffAuthComplete> & import("@ngrx/effects").CreateEffectMetadata;
|
|
17
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthLoginEffects<any, any>, never>;
|
|
18
19
|
static ɵprov: i0.ɵɵInjectableDeclaration<DaffAuthLoginEffects<any, any>>;
|
|
19
20
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Router } from '@angular/router';
|
|
2
|
+
import { Actions } from '@ngrx/effects';
|
|
3
|
+
import { DaffAuthStateConfig } from '../config/public_api';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Redirects the user to certain pages based on certain auth actions.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DaffAuthRedirectEffects {
|
|
9
|
+
private actions$;
|
|
10
|
+
private router;
|
|
11
|
+
private config;
|
|
12
|
+
constructor(actions$: Actions, router: Router, config: DaffAuthStateConfig);
|
|
13
|
+
redirectAfterLoginOrRegister$: import("rxjs").Observable<never> & import("@ngrx/effects").CreateEffectMetadata;
|
|
14
|
+
redirectAfterLogout$: import("rxjs").Observable<never> & import("@ngrx/effects").CreateEffectMetadata;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthRedirectEffects, never>;
|
|
16
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffAuthRedirectEffects>;
|
|
17
|
+
}
|
|
@@ -3,7 +3,7 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { DaffAuthResetPasswordInfo, DaffAuthStorageService } from '@daffodil/auth';
|
|
4
4
|
import { DaffResetPasswordServiceInterface } from '@daffodil/auth/driver';
|
|
5
5
|
import { ErrorTransformer } from '@daffodil/core/state';
|
|
6
|
-
import { DaffResetPasswordSuccess, DaffResetPasswordFailure, DaffAuthComplete } from '../actions/public_api';
|
|
6
|
+
import { DaffResetPasswordSuccess, DaffResetPasswordFailure, DaffAuthComplete, DaffAuthServerSide, DaffAuthStorageFailure } from '../actions/public_api';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
export declare class DaffAuthResetPasswordEffects<T extends DaffAuthResetPasswordInfo = DaffAuthResetPasswordInfo> {
|
|
9
9
|
private actions$;
|
|
@@ -12,7 +12,7 @@ export declare class DaffAuthResetPasswordEffects<T extends DaffAuthResetPasswor
|
|
|
12
12
|
private storage;
|
|
13
13
|
constructor(actions$: Actions, driver: DaffResetPasswordServiceInterface<T>, errorMatcher: ErrorTransformer, storage: DaffAuthStorageService);
|
|
14
14
|
sendResetEmail$: Observable<any>;
|
|
15
|
-
resetPassword$: Observable<DaffAuthComplete | DaffResetPasswordSuccess | DaffResetPasswordFailure> & import("@ngrx/effects").CreateEffectMetadata;
|
|
15
|
+
resetPassword$: Observable<DaffAuthStorageFailure | DaffAuthServerSide | DaffAuthComplete | DaffResetPasswordSuccess | DaffResetPasswordFailure> & import("@ngrx/effects").CreateEffectMetadata;
|
|
16
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthResetPasswordEffects<any>, never>;
|
|
17
17
|
static ɵprov: i0.ɵɵInjectableDeclaration<DaffAuthResetPasswordEffects<any>>;
|
|
18
18
|
}
|