@spacelr/sdk 0.18.0 → 0.18.1

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.mjs CHANGED
@@ -1999,11 +1999,19 @@ var AuthModule = class _AuthModule {
1999
1999
  await this.tokenManager.clearTokens();
2000
2000
  this.emitState("unauthenticated");
2001
2001
  }
2002
+ /**
2003
+ * Verify an email address with the token from the verification email.
2004
+ *
2005
+ * The token is sent in the request BODY, never the URL (#941): a query
2006
+ * string reaches server, proxy and CDN logs. When the project mints one, the
2007
+ * response carries a one-time `loginCode`; pass it to `exchangeCode` to sign
2008
+ * the user in.
2009
+ */
2002
2010
  async verifyEmail(token) {
2003
2011
  return this.http.request({
2004
- method: "GET",
2012
+ method: "POST",
2005
2013
  path: "/auth/verify-email",
2006
- query: { token }
2014
+ body: { token }
2007
2015
  });
2008
2016
  }
2009
2017
  async resendVerification(email) {
@@ -2248,6 +2256,11 @@ var AuthModule = class _AuthModule {
2248
2256
  /**
2249
2257
  * Fetch WebAuthn attestation options to register a new passkey for the
2250
2258
  * currently authenticated user.
2259
+ *
2260
+ * Requires a recent interactive login (within 5 minutes). Otherwise the
2261
+ * server answers 401 `STALE_SESSION` and this throws
2262
+ * {@link SpacelrStepUpRequiredError}: sign the user in again, then retry.
2263
+ * A token refresh does not help.
2251
2264
  */
2252
2265
  async beginPasskeyRegistration() {
2253
2266
  return this.http.request({
@@ -2262,6 +2275,11 @@ var AuthModule = class _AuthModule {
2262
2275
  * against the options returned by `beginPasskeyRegistration()`, saving the
2263
2276
  * new credential under the current user. This does not issue tokens or
2264
2277
  * change auth state — the caller is already authenticated.
2278
+ *
2279
+ * Requires a recent interactive login (within 5 minutes). Otherwise the
2280
+ * server answers 401 `STALE_SESSION` and this throws
2281
+ * {@link SpacelrStepUpRequiredError}: sign the user in again, then retry.
2282
+ * A token refresh does not help.
2265
2283
  */
2266
2284
  async verifyPasskeyRegistration(response, label) {
2267
2285
  return this.http.request({
@@ -2511,6 +2529,11 @@ var AuthModule = class _AuthModule {
2511
2529
  /**
2512
2530
  * Approve the pending device link (signed-in device A). Authenticated.
2513
2531
  * Ownership/identity are derived server-side from the JWT.
2532
+ *
2533
+ * Requires a recent interactive login (within 5 minutes). Otherwise the
2534
+ * server answers 401 `STALE_SESSION` and this throws
2535
+ * {@link SpacelrStepUpRequiredError}: sign the user in again, then retry.
2536
+ * A token refresh does not help.
2514
2537
  */
2515
2538
  async approveDeviceLink(code) {
2516
2539
  return this.http.request({