@palbase/web 7.1.0 → 7.2.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/dist/index.cjs CHANGED
@@ -936,6 +936,26 @@ var PalbeAuth = class {
936
936
  })
937
937
  );
938
938
  }
939
+ /**
940
+ * Give a passwordless account its FIRST password, in-app.
941
+ *
942
+ * For accounts created with a passkey or a social provider: they have no
943
+ * current password, so `updatePassword` cannot serve them — it sends one and
944
+ * the server answers 401. Before this existed the only route was the
945
+ * password-RESET e-mail, which asks someone already signed in to go find
946
+ * their inbox.
947
+ *
948
+ * Requires a RECENT sign-in, not merely a session: a first password is a
949
+ * credential that outlives the rest, so the server answers 403
950
+ * `reauthentication_required` on a stale one — the same gate
951
+ * `registerPasskey` carries. An account that already has a password gets 409
952
+ * `password_already_set`; change it with `updatePassword` instead.
953
+ *
954
+ * The session stays valid — no re-login.
955
+ */
956
+ async setPassword(newPassword) {
957
+ unwrap(await this.rt.authClient.setPassword({ new_password: newPassword }));
958
+ }
939
959
  async verifyEmail(params) {
940
960
  unwrap(await this.rt.authClient.verifyEmail(params));
941
961
  }
@@ -7891,7 +7911,7 @@ function localStorageSessionStorage(key = DEFAULT_KEY) {
7891
7911
  }
7892
7912
 
7893
7913
  // src/version.ts
7894
- var VERSION = "7.1.0";
7914
+ var VERSION = "7.2.0";
7895
7915
 
7896
7916
  // src/internal.ts
7897
7917
  function getRuntime() {