@rdlabo/ionic-angular-kit 21.4.9 → 21.4.11
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/README.md +13 -1
- package/fesm2022/rdlabo-ionic-angular-kit-auth-firebase.mjs +18 -1
- package/fesm2022/rdlabo-ionic-angular-kit-auth-firebase.mjs.map +1 -1
- package/fesm2022/rdlabo-ionic-angular-kit-offline.mjs +1 -1
- package/fesm2022/rdlabo-ionic-angular-kit-offline.mjs.map +1 -1
- package/fesm2022/rdlabo-ionic-angular-kit.mjs +21 -12
- package/fesm2022/rdlabo-ionic-angular-kit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/rdlabo-ionic-angular-kit-auth-firebase.d.ts +13 -2
- package/types/rdlabo-ionic-angular-kit.d.ts +16 -3
package/package.json
CHANGED
|
@@ -107,6 +107,17 @@ interface KitAuthHooks {
|
|
|
107
107
|
error?: (error: unknown) => void | Promise<unknown>;
|
|
108
108
|
finally?: () => void | Promise<unknown>;
|
|
109
109
|
}
|
|
110
|
+
/** Optional identity guard evaluated immediately before Firebase sign-out is invoked. */
|
|
111
|
+
interface KitSignOutOptions {
|
|
112
|
+
/**
|
|
113
|
+
* Only sign out when this exact Firebase User object is still current after `before` completes.
|
|
114
|
+
*
|
|
115
|
+
* @remarks
|
|
116
|
+
* A different object is treated as a newer authentication session even when it has the same UID.
|
|
117
|
+
* A mismatch resolves `false`, skips `success` and `error`, and still runs `finally`.
|
|
118
|
+
*/
|
|
119
|
+
expectedUser?: User;
|
|
120
|
+
}
|
|
110
121
|
/**
|
|
111
122
|
* Sign in with email and password.
|
|
112
123
|
*
|
|
@@ -131,7 +142,7 @@ declare const kitSignUp: (auth: Auth, email: string, password: string, hooks?: K
|
|
|
131
142
|
* App-specific cleanup (clearing stores, toasts, navigation, third-party logout) is the caller's,
|
|
132
143
|
* done via the hooks — the kit only owns the Firebase op. `true` on success, `false` on failure.
|
|
133
144
|
*/
|
|
134
|
-
declare const kitSignOut: (auth: Auth, hooks?: KitAuthHooks) => Promise<boolean>;
|
|
145
|
+
declare const kitSignOut: (auth: Auth, hooks?: KitAuthHooks, options?: KitSignOutOptions) => Promise<boolean>;
|
|
135
146
|
/** Send a password-reset email. `true` on success, `false` on failure. */
|
|
136
147
|
declare const kitSendPasswordReset: (auth: Auth, email: string, hooks?: KitAuthHooks) => Promise<boolean>;
|
|
137
148
|
/**
|
|
@@ -297,4 +308,4 @@ interface KitResolveAuthStatusOptions {
|
|
|
297
308
|
declare const kitResolveAuthStatus: (user: User | null, options?: KitResolveAuthStatusOptions) => KitAuthStatus;
|
|
298
309
|
|
|
299
310
|
export { KIT_DEFAULT_AUTH_TEXT, KIT_FIREBASE_AUTH, kitAuthState, kitGetIdToken, kitLinkEmailPassword, kitReauthWithRetry, kitResolveAuthStatus, kitSendEmailVerification, kitSendPasswordReset, kitSignIn, kitSignInAnonymously, kitSignOut, kitSignUp, kitUnlinkProvider, kitUpdateEmail, kitUpdatePassword, provideKitFirebase, provideKitFirebaseAnalytics };
|
|
300
|
-
export type { KitAuthHooks, KitAuthMessage, KitAuthStatus, KitAuthText, KitFirebaseConfig, KitReauthWithRetryOptions, KitResolveAuthStatusOptions };
|
|
311
|
+
export type { KitAuthHooks, KitAuthMessage, KitAuthStatus, KitAuthText, KitFirebaseConfig, KitReauthWithRetryOptions, KitResolveAuthStatusOptions, KitSignOutOptions };
|
|
@@ -899,7 +899,15 @@ interface KitRemoteAccessRecovery {
|
|
|
899
899
|
* @returns `false` when a newer logout or identity transition superseded this activation.
|
|
900
900
|
*/
|
|
901
901
|
activate(lease: KitAuthAccessLease): Promise<boolean>;
|
|
902
|
-
|
|
902
|
+
/**
|
|
903
|
+
* Resume remote-only work after access has been published.
|
|
904
|
+
*
|
|
905
|
+
* @param lease - Post-grant lease supplied by the kit. Check it after every await before
|
|
906
|
+
* navigation or other user-visible side effects, because logout or a newer identity transition
|
|
907
|
+
* may supersede this resume while transport work is settling. Optional for source compatibility
|
|
908
|
+
* with callers that manually resumed a recovery result before leases were introduced.
|
|
909
|
+
*/
|
|
910
|
+
resume(lease?: KitAuthAccessLease): Promise<void>;
|
|
903
911
|
}
|
|
904
912
|
/** Recovery-specific authentication configuration consumed by {@link KitAuthRecoveryService}. */
|
|
905
913
|
interface KitAuthRecoveryConfig {
|
|
@@ -945,8 +953,13 @@ declare class KitAuthAccessService {
|
|
|
945
953
|
suspend(lease: KitAuthAccessLease): boolean;
|
|
946
954
|
/** Publish a verified local-replica-only session. */
|
|
947
955
|
grantLocal(): void;
|
|
948
|
-
/**
|
|
949
|
-
|
|
956
|
+
/**
|
|
957
|
+
* Publish a remotely authenticated session and return the lease that owns that publication.
|
|
958
|
+
*
|
|
959
|
+
* The revision is fixed before synchronous `mode$` subscribers run. A subscriber that starts a
|
|
960
|
+
* newer logout or identity transition therefore makes the returned lease stale.
|
|
961
|
+
*/
|
|
962
|
+
grantRemote(): KitAuthAccessLease;
|
|
950
963
|
/** Revoke both local and remote access. */
|
|
951
964
|
clear(): void;
|
|
952
965
|
static ɵfac: i0.ɵɵFactoryDeclaration<KitAuthAccessService, never>;
|