@stackframe/stack 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 +4 -4
|
@@ -519,14 +519,11 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
|
|
|
519
519
|
clientMetadata: crud.client_metadata,
|
|
520
520
|
clientReadOnlyMetadata: crud.client_read_only_metadata,
|
|
521
521
|
async inviteUser(options) {
|
|
522
|
-
if (!options.callbackUrl && !await app._getCurrentUrl()) {
|
|
523
|
-
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: ... })`");
|
|
524
|
-
}
|
|
525
522
|
await app._interface.sendTeamInvitation({
|
|
526
523
|
teamId: crud.id,
|
|
527
524
|
email: options.email,
|
|
528
525
|
session,
|
|
529
|
-
callbackUrl: options.callbackUrl ?? (0, import_url.constructRedirectUrl)(app.urls.teamInvitation)
|
|
526
|
+
callbackUrl: options.callbackUrl ?? (0, import_url.constructRedirectUrl)(app.urls.teamInvitation, "callbackUrl")
|
|
530
527
|
});
|
|
531
528
|
await app._teamInvitationsCache.refresh([session, crud.id]);
|
|
532
529
|
},
|
|
@@ -565,8 +562,12 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
|
|
|
565
562
|
isVerified: crud.is_verified,
|
|
566
563
|
isPrimary: crud.is_primary,
|
|
567
564
|
usedForAuth: crud.used_for_auth,
|
|
568
|
-
async sendVerificationEmail() {
|
|
569
|
-
await app._interface.sendCurrentUserContactChannelVerificationEmail(
|
|
565
|
+
async sendVerificationEmail(options) {
|
|
566
|
+
await app._interface.sendCurrentUserContactChannelVerificationEmail(
|
|
567
|
+
crud.id,
|
|
568
|
+
options?.callbackUrl || (0, import_url.constructRedirectUrl)(app.urls.emailVerification, "callbackUrl"),
|
|
569
|
+
session
|
|
570
|
+
);
|
|
570
571
|
},
|
|
571
572
|
async update(data) {
|
|
572
573
|
await app._interface.updateClientContactChannel(crud.id, (0, import_contact_channels.contactChannelUpdateOptionsToCrud)(data), session);
|
|
@@ -668,6 +669,7 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
|
|
|
668
669
|
oauthProviders: crud.oauth_providers,
|
|
669
670
|
passkeyAuthEnabled: crud.passkey_auth_enabled,
|
|
670
671
|
isMultiFactorRequired: crud.requires_totp_mfa,
|
|
672
|
+
isAnonymous: crud.is_anonymous,
|
|
671
673
|
toClientJson() {
|
|
672
674
|
return crud;
|
|
673
675
|
}
|
|
@@ -794,10 +796,11 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
|
|
|
794
796
|
if (!crud.primary_email) {
|
|
795
797
|
throw new import_errors.StackAssertionError("User does not have a primary email");
|
|
796
798
|
}
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
799
|
+
return await app._interface.sendVerificationEmail(
|
|
800
|
+
crud.primary_email,
|
|
801
|
+
options?.callbackUrl ?? (0, import_url.constructRedirectUrl)(app.urls.emailVerification, "callbackUrl"),
|
|
802
|
+
session
|
|
803
|
+
);
|
|
801
804
|
},
|
|
802
805
|
async updatePassword(options) {
|
|
803
806
|
const result = await app._interface.updatePassword(options, session);
|
|
@@ -1017,16 +1020,10 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
|
|
|
1017
1020
|
return await this._redirectToHandler("teamInvitation", options);
|
|
1018
1021
|
}
|
|
1019
1022
|
async sendForgotPasswordEmail(email, options) {
|
|
1020
|
-
|
|
1021
|
-
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: ... })`");
|
|
1022
|
-
}
|
|
1023
|
-
return await this._interface.sendForgotPasswordEmail(email, options?.callbackUrl ?? (0, import_url.constructRedirectUrl)(this.urls.passwordReset));
|
|
1023
|
+
return await this._interface.sendForgotPasswordEmail(email, options?.callbackUrl ?? (0, import_url.constructRedirectUrl)(this.urls.passwordReset, "callbackUrl"));
|
|
1024
1024
|
}
|
|
1025
1025
|
async sendMagicLinkEmail(email, options) {
|
|
1026
|
-
|
|
1027
|
-
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: ... })`");
|
|
1028
|
-
}
|
|
1029
|
-
return await this._interface.sendMagicLinkEmail(email, options?.callbackUrl ?? (0, import_url.constructRedirectUrl)(this.urls.magicLinkCallback));
|
|
1026
|
+
return await this._interface.sendMagicLinkEmail(email, options?.callbackUrl ?? (0, import_url.constructRedirectUrl)(this.urls.magicLinkCallback, "callbackUrl"));
|
|
1030
1027
|
}
|
|
1031
1028
|
async resetPassword(options) {
|
|
1032
1029
|
return await this._interface.resetPassword(options);
|
|
@@ -1213,7 +1210,7 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
|
|
|
1213
1210
|
async signUpWithCredential(options) {
|
|
1214
1211
|
this._ensurePersistentTokenStore();
|
|
1215
1212
|
const session = await this._getSession();
|
|
1216
|
-
const emailVerificationRedirectUrl = options.verificationCallbackUrl ?? (0, import_url.constructRedirectUrl)(this.urls.emailVerification);
|
|
1213
|
+
const emailVerificationRedirectUrl = options.verificationCallbackUrl ?? (0, import_url.constructRedirectUrl)(this.urls.emailVerification, "verificationCallbackUrl");
|
|
1217
1214
|
const result = await this._interface.signUpWithCredential(
|
|
1218
1215
|
options.email,
|
|
1219
1216
|
options.password,
|