@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.
- package/CHANGELOG.md +10 -0
- package/dist/esm/lib/auth.js +6 -6
- package/dist/esm/lib/auth.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js +16 -19
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/common.js +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.js +2 -8
- package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.js.map +1 -1
- package/dist/esm/lib/stack-app/users/index.js.map +1 -1
- package/dist/esm/utils/url.js +2 -2
- package/dist/esm/utils/url.js.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/lib/auth.js +6 -6
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js +16 -19
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/common.js +1 -1
- package/dist/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/server-app-impl.js +2 -8
- package/dist/lib/stack-app/apps/implementations/server-app-impl.js.map +1 -1
- package/dist/lib/stack-app/users/index.js.map +1 -1
- package/dist/utils/url.js +2 -2
- package/dist/utils/url.js.map +1 -1
- package/package.json +3 -3
|
@@ -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(
|
|
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
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|