@daffodil/auth 0.60.0 → 0.62.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/routing/effects/redirect.effects.mjs +2 -8
- package/esm2020/routing/guards/guest-only.guard.mjs +2 -2
- package/esm2020/routing/guards/member-only.guard.mjs +2 -2
- package/esm2020/routing/helpers/public_api.mjs +2 -0
- package/esm2020/routing/helpers/redirect-unauthenticated-hook-factory.mjs +16 -0
- package/esm2020/routing/public_api.mjs +2 -1
- package/esm2020/routing/redirect.module.mjs +20 -3
- package/esm2020/state/actions/auth.actions.mjs +12 -1
- package/esm2020/state/effects/auth.effects.mjs +20 -6
- package/esm2020/state/effects/login.effects.mjs +1 -1
- package/esm2020/state/injection-tokens/public_api.mjs +2 -0
- package/esm2020/state/injection-tokens/unauthenticated/hook.token.mjs +16 -0
- package/esm2020/state/injection-tokens/unauthenticated/hook.type.mjs +2 -0
- package/esm2020/state/injection-tokens/unauthenticated/hooks.token.mjs +28 -0
- package/esm2020/state/injection-tokens/unauthenticated/public_api.mjs +2 -0
- package/esm2020/state/public_api.mjs +2 -1
- package/fesm2015/daffodil-auth-routing.mjs +35 -13
- package/fesm2015/daffodil-auth-routing.mjs.map +1 -1
- package/fesm2015/daffodil-auth-state.mjs +72 -8
- package/fesm2015/daffodil-auth-state.mjs.map +1 -1
- package/fesm2020/daffodil-auth-routing.mjs +35 -13
- package/fesm2020/daffodil-auth-routing.mjs.map +1 -1
- package/fesm2020/daffodil-auth-state.mjs +71 -7
- package/fesm2020/daffodil-auth-state.mjs.map +1 -1
- package/package.json +1 -1
- package/routing/effects/redirect.effects.d.ts +0 -2
- package/routing/helpers/public_api.d.ts +1 -0
- package/routing/helpers/redirect-unauthenticated-hook-factory.d.ts +4 -0
- package/routing/package.json +1 -1
- package/routing/public_api.d.ts +1 -0
- package/state/actions/auth.actions.d.ts +7 -1
- package/state/effects/auth.effects.d.ts +5 -2
- package/state/injection-tokens/public_api.d.ts +1 -0
- package/state/injection-tokens/unauthenticated/hook.token.d.ts +9 -0
- package/state/injection-tokens/unauthenticated/hook.type.d.ts +9 -0
- package/state/injection-tokens/unauthenticated/hooks.token.d.ts +22 -0
- package/state/injection-tokens/unauthenticated/public_api.d.ts +2 -0
- package/state/package.json +1 -1
- package/state/public_api.d.ts +1 -0
- package/state/testing/package.json +1 -1
- package/testing/package.json +1 -1
|
@@ -3,8 +3,9 @@ import { DaffAuthStorageService } from '@daffodil/auth';
|
|
|
3
3
|
import { DaffAuthDriverTokenCheck } from '@daffodil/auth/driver';
|
|
4
4
|
import { ErrorTransformer } from '@daffodil/core/state';
|
|
5
5
|
import { DaffDriverHttpClientCacheServiceInterface } from '@daffodil/driver';
|
|
6
|
-
import { DaffAuthCheckSuccess, DaffAuthCheckFailure, DaffAuthCheck, DaffAuthStorageFailure, DaffAuthServerSide, DaffAuthActions, DaffAuthLoginActions } from '../actions/public_api';
|
|
6
|
+
import { DaffAuthCheckSuccess, DaffAuthCheckFailure, DaffAuthCheck, DaffAuthStorageFailure, DaffAuthServerSide, DaffAuthActions, DaffAuthLoginActions, DaffAuthResetToUnauthenticated } from '../actions/public_api';
|
|
7
7
|
import { DaffAuthStateConfig } from '../config/public_api';
|
|
8
|
+
import { DaffAuthUnauthenticatedHook } from '../injection-tokens/public_api';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
export declare class DaffAuthEffects {
|
|
10
11
|
private actions$;
|
|
@@ -13,10 +14,12 @@ export declare class DaffAuthEffects {
|
|
|
13
14
|
private storage;
|
|
14
15
|
private config;
|
|
15
16
|
private clientCache;
|
|
16
|
-
|
|
17
|
+
private unauthenticatedHook;
|
|
18
|
+
constructor(actions$: Actions<DaffAuthActions | DaffAuthLoginActions>, tokenCheck: DaffAuthDriverTokenCheck, errorMatcher: ErrorTransformer, storage: DaffAuthStorageService, config: DaffAuthStateConfig, clientCache: DaffDriverHttpClientCacheServiceInterface, unauthenticatedHook: DaffAuthUnauthenticatedHook);
|
|
17
19
|
check$: import("rxjs").Observable<DaffAuthCheckSuccess | DaffAuthCheckFailure> & import("@ngrx/effects").CreateEffectMetadata;
|
|
18
20
|
removeAuthToken$: import("rxjs").Observable<DaffAuthStorageFailure | DaffAuthServerSide> & import("@ngrx/effects").CreateEffectMetadata;
|
|
19
21
|
authCheckInterval$: import("rxjs").Observable<DaffAuthStorageFailure | DaffAuthServerSide | DaffAuthCheck> & import("@ngrx/effects").CreateEffectMetadata;
|
|
22
|
+
resetToUnauthenticated$: import("rxjs").Observable<DaffAuthResetToUnauthenticated> & import("@ngrx/effects").CreateEffectMetadata;
|
|
20
23
|
clearClientCache$: import("rxjs").Observable<never> & import("@ngrx/effects").CreateEffectMetadata;
|
|
21
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthEffects, never>;
|
|
22
25
|
static ɵprov: i0.ɵɵInjectableDeclaration<DaffAuthEffects>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './unauthenticated/public_api';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { DaffAuthUnauthenticatedHook } from './hook.type';
|
|
3
|
+
/**
|
|
4
|
+
* An internal token to hold the unauthenticated hook.
|
|
5
|
+
* Combines the multi provided hooks into a single function.
|
|
6
|
+
*
|
|
7
|
+
* @docs-private
|
|
8
|
+
*/
|
|
9
|
+
export declare const DAFF_AUTH_UNAUTHENTICATED_HOOK: InjectionToken<DaffAuthUnauthenticatedHook>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Action } from '@ngrx/store';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
/**
|
|
4
|
+
* A function that is called when the user is unauthenticated.
|
|
5
|
+
* When a logged-in user is unauthenticated, various packages may perform cleanup tasks.
|
|
6
|
+
* These hooks will be called in no particular order before the client driver state is reset.
|
|
7
|
+
* Daffodil will wait for at least one emission from each hook before proceeding.
|
|
8
|
+
*/
|
|
9
|
+
export declare type DaffAuthUnauthenticatedHook = (trigger: Action['type']) => Observable<unknown>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { InjectionToken, Provider } from '@angular/core';
|
|
2
|
+
import { DaffAuthUnauthenticatedHook } from './hook.type';
|
|
3
|
+
/**
|
|
4
|
+
* A token to hold the unauthenticated hooks.
|
|
5
|
+
* See {@link DaffAuthUnauthenticatedHook}.
|
|
6
|
+
*
|
|
7
|
+
* Prefer using {@link daffAuthProvideUnauthenticatedHooks}.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DAFF_AUTH_UNAUTHENTICATED_HOOKS: InjectionToken<DaffAuthUnauthenticatedHook[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Provides {@link DAFF_AUTH_UNAUTHENTICATED_HOOKS}.
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* providers: [
|
|
15
|
+
* ...daffAuthProvideUnauthenticatedHooks(
|
|
16
|
+
* myReducer1,
|
|
17
|
+
* myReducer2
|
|
18
|
+
* )
|
|
19
|
+
* ]
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function daffAuthProvideUnauthenticatedHooks(...hooks: DaffAuthUnauthenticatedHook[]): Provider[];
|
package/state/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@daffodil/auth/state","module":"../fesm2015/daffodil-auth-state.mjs","es2020":"../fesm2020/daffodil-auth-state.mjs","esm2020":"../esm2020/state/daffodil-auth-state.mjs","fesm2020":"../fesm2020/daffodil-auth-state.mjs","fesm2015":"../fesm2015/daffodil-auth-state.mjs","typings":"daffodil-auth-state.d.ts","sideEffects":false,"version":"0.
|
|
1
|
+
{"name":"@daffodil/auth/state","module":"../fesm2015/daffodil-auth-state.mjs","es2020":"../fesm2020/daffodil-auth-state.mjs","esm2020":"../esm2020/state/daffodil-auth-state.mjs","fesm2020":"../fesm2020/daffodil-auth-state.mjs","fesm2015":"../fesm2015/daffodil-auth-state.mjs","typings":"daffodil-auth-state.d.ts","sideEffects":false,"version":"0.62.0"}
|
package/state/public_api.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@daffodil/auth/state/testing","module":"../../fesm2015/daffodil-auth-state-testing.mjs","es2020":"../../fesm2020/daffodil-auth-state-testing.mjs","esm2020":"../../esm2020/state/testing/daffodil-auth-state-testing.mjs","fesm2020":"../../fesm2020/daffodil-auth-state-testing.mjs","fesm2015":"../../fesm2015/daffodil-auth-state-testing.mjs","typings":"daffodil-auth-state-testing.d.ts","sideEffects":false,"version":"0.
|
|
1
|
+
{"name":"@daffodil/auth/state/testing","module":"../../fesm2015/daffodil-auth-state-testing.mjs","es2020":"../../fesm2020/daffodil-auth-state-testing.mjs","esm2020":"../../esm2020/state/testing/daffodil-auth-state-testing.mjs","fesm2020":"../../fesm2020/daffodil-auth-state-testing.mjs","fesm2015":"../../fesm2015/daffodil-auth-state-testing.mjs","typings":"daffodil-auth-state-testing.d.ts","sideEffects":false,"version":"0.62.0"}
|
package/testing/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@daffodil/auth/testing","module":"../fesm2015/daffodil-auth-testing.mjs","es2020":"../fesm2020/daffodil-auth-testing.mjs","esm2020":"../esm2020/testing/daffodil-auth-testing.mjs","fesm2020":"../fesm2020/daffodil-auth-testing.mjs","fesm2015":"../fesm2015/daffodil-auth-testing.mjs","typings":"daffodil-auth-testing.d.ts","sideEffects":false,"version":"0.
|
|
1
|
+
{"name":"@daffodil/auth/testing","module":"../fesm2015/daffodil-auth-testing.mjs","es2020":"../fesm2020/daffodil-auth-testing.mjs","esm2020":"../esm2020/testing/daffodil-auth-testing.mjs","fesm2020":"../fesm2020/daffodil-auth-testing.mjs","fesm2015":"../fesm2015/daffodil-auth-testing.mjs","typings":"daffodil-auth-testing.d.ts","sideEffects":false,"version":"0.62.0"}
|