@nauth-toolkit/client 0.1.6 → 0.1.8

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.
@@ -214,6 +214,8 @@ var defaultEndpoints = {
214
214
  profile: "/profile",
215
215
  changePassword: "/change-password",
216
216
  requestPasswordChange: "/request-password-change",
217
+ forgotPassword: "/forgot-password",
218
+ confirmForgotPassword: "/forgot-password/confirm",
217
219
  mfaStatus: "/mfa/status",
218
220
  mfaDevices: "/mfa/devices",
219
221
  mfaSetupData: "/mfa/setup-data",
@@ -825,6 +827,20 @@ var _NAuthClient = class _NAuthClient {
825
827
  const payload = { currentPassword: oldPassword, newPassword };
826
828
  await this.post(this.config.endpoints.changePassword, payload, true);
827
829
  }
830
+ /**
831
+ * Request a password reset code (forgot password).
832
+ */
833
+ async forgotPassword(identifier) {
834
+ const payload = { identifier };
835
+ return this.post(this.config.endpoints.forgotPassword, payload);
836
+ }
837
+ /**
838
+ * Confirm a password reset code and set a new password.
839
+ */
840
+ async confirmForgotPassword(identifier, code, newPassword) {
841
+ const payload = { identifier, code, newPassword };
842
+ return this.post(this.config.endpoints.confirmForgotPassword, payload);
843
+ }
828
844
  /**
829
845
  * Request password change (must change on next login).
830
846
  */
@@ -1562,6 +1578,21 @@ var AuthService = class {
1562
1578
  return (0, import_rxjs2.from)(this.client.refreshTokens());
1563
1579
  }
1564
1580
  // ============================================================================
1581
+ // Account Recovery (Forgot Password)
1582
+ // ============================================================================
1583
+ /**
1584
+ * Request a password reset code (forgot password).
1585
+ */
1586
+ forgotPassword(identifier) {
1587
+ return (0, import_rxjs2.from)(this.client.forgotPassword(identifier));
1588
+ }
1589
+ /**
1590
+ * Confirm a password reset code and set a new password.
1591
+ */
1592
+ confirmForgotPassword(identifier, code, newPassword) {
1593
+ return (0, import_rxjs2.from)(this.client.confirmForgotPassword(identifier, code, newPassword));
1594
+ }
1595
+ // ============================================================================
1565
1596
  // Challenge Flow Methods (Essential for any auth flow)
1566
1597
  // ============================================================================
1567
1598
  /**