@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rdlabo/ionic-angular-kit",
3
- "version": "21.4.9",
3
+ "version": "21.4.11",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/rdlabo-team/ionic-angular-library.git"
@@ -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
- resume(): Promise<void>;
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
- /** Publish a remotely authenticated session. */
949
- grantRemote(): void;
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>;