@stackframe/react 2.8.1 → 2.8.2

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.
@@ -512,14 +512,11 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
512
512
  clientMetadata: crud.client_metadata,
513
513
  clientReadOnlyMetadata: crud.client_read_only_metadata,
514
514
  async inviteUser(options) {
515
- if (!options.callbackUrl && !await app._getCurrentUrl()) {
516
- throw new Error("Cannot invite user without a callback URL from the server or without a redirect method. Make sure you pass the `callbackUrl` option: `inviteUser({ email, callbackUrl: ... })`");
517
- }
518
515
  await app._interface.sendTeamInvitation({
519
516
  teamId: crud.id,
520
517
  email: options.email,
521
518
  session,
522
- callbackUrl: options.callbackUrl ?? (0, import_url.constructRedirectUrl)(app.urls.teamInvitation)
519
+ callbackUrl: options.callbackUrl ?? (0, import_url.constructRedirectUrl)(app.urls.teamInvitation, "callbackUrl")
523
520
  });
524
521
  await app._teamInvitationsCache.refresh([session, crud.id]);
525
522
  },
@@ -558,8 +555,12 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
558
555
  isVerified: crud.is_verified,
559
556
  isPrimary: crud.is_primary,
560
557
  usedForAuth: crud.used_for_auth,
561
- async sendVerificationEmail() {
562
- await app._interface.sendCurrentUserContactChannelVerificationEmail(crud.id, (0, import_url.constructRedirectUrl)(app.urls.emailVerification), session);
558
+ async sendVerificationEmail(options) {
559
+ await app._interface.sendCurrentUserContactChannelVerificationEmail(
560
+ crud.id,
561
+ options?.callbackUrl || (0, import_url.constructRedirectUrl)(app.urls.emailVerification, "callbackUrl"),
562
+ session
563
+ );
563
564
  },
564
565
  async update(data) {
565
566
  await app._interface.updateClientContactChannel(crud.id, (0, import_contact_channels.contactChannelUpdateOptionsToCrud)(data), session);
@@ -661,6 +662,7 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
661
662
  oauthProviders: crud.oauth_providers,
662
663
  passkeyAuthEnabled: crud.passkey_auth_enabled,
663
664
  isMultiFactorRequired: crud.requires_totp_mfa,
665
+ isAnonymous: crud.is_anonymous,
664
666
  toClientJson() {
665
667
  return crud;
666
668
  }
@@ -787,10 +789,11 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
787
789
  if (!crud.primary_email) {
788
790
  throw new import_errors.StackAssertionError("User does not have a primary email");
789
791
  }
790
- if (!options?.callbackUrl && !await app._getCurrentUrl()) {
791
- throw new Error("Cannot send verification email without a callback URL from the server or without a redirect method. Make sure you pass the `callbackUrl` option: `sendVerificationEmail({ callbackUrl: ... })`");
792
- }
793
- return await app._interface.sendVerificationEmail(crud.primary_email, options?.callbackUrl ?? (0, import_url.constructRedirectUrl)(app.urls.emailVerification), session);
792
+ return await app._interface.sendVerificationEmail(
793
+ crud.primary_email,
794
+ options?.callbackUrl ?? (0, import_url.constructRedirectUrl)(app.urls.emailVerification, "callbackUrl"),
795
+ session
796
+ );
794
797
  },
795
798
  async updatePassword(options) {
796
799
  const result = await app._interface.updatePassword(options, session);
@@ -1005,16 +1008,10 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
1005
1008
  return await this._redirectToHandler("teamInvitation", options);
1006
1009
  }
1007
1010
  async sendForgotPasswordEmail(email, options) {
1008
- if (!options?.callbackUrl && !await this._getCurrentUrl()) {
1009
- throw new Error("Cannot send forgot password email without a callback URL from the server or without a redirect method. Make sure you pass the `callbackUrl` option: `sendForgotPasswordEmail({ email, callbackUrl: ... })`");
1010
- }
1011
- return await this._interface.sendForgotPasswordEmail(email, options?.callbackUrl ?? (0, import_url.constructRedirectUrl)(this.urls.passwordReset));
1011
+ return await this._interface.sendForgotPasswordEmail(email, options?.callbackUrl ?? (0, import_url.constructRedirectUrl)(this.urls.passwordReset, "callbackUrl"));
1012
1012
  }
1013
1013
  async sendMagicLinkEmail(email, options) {
1014
- if (!options?.callbackUrl && !await this._getCurrentUrl()) {
1015
- throw new Error("Cannot send magic link email without a callback URL from the server or without a redirect method. Make sure you pass the `callbackUrl` option: `sendMagicLinkEmail({ email, callbackUrl: ... })`");
1016
- }
1017
- return await this._interface.sendMagicLinkEmail(email, options?.callbackUrl ?? (0, import_url.constructRedirectUrl)(this.urls.magicLinkCallback));
1014
+ return await this._interface.sendMagicLinkEmail(email, options?.callbackUrl ?? (0, import_url.constructRedirectUrl)(this.urls.magicLinkCallback, "callbackUrl"));
1018
1015
  }
1019
1016
  async resetPassword(options) {
1020
1017
  return await this._interface.resetPassword(options);
@@ -1201,7 +1198,7 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
1201
1198
  async signUpWithCredential(options) {
1202
1199
  this._ensurePersistentTokenStore();
1203
1200
  const session = await this._getSession();
1204
- const emailVerificationRedirectUrl = options.verificationCallbackUrl ?? (0, import_url.constructRedirectUrl)(this.urls.emailVerification);
1201
+ const emailVerificationRedirectUrl = options.verificationCallbackUrl ?? (0, import_url.constructRedirectUrl)(this.urls.emailVerification, "verificationCallbackUrl");
1205
1202
  const result = await this._interface.signUpWithCredential(
1206
1203
  options.email,
1207
1204
  options.password,