@stackframe/stack 2.8.12 → 2.8.16
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 +38 -0
- package/dist/components/api-key-dialogs.js +5 -4
- package/dist/components/api-key-dialogs.js.map +1 -1
- package/dist/components/credential-sign-in.js +4 -4
- package/dist/components/credential-sign-up.js +3 -3
- package/dist/components/elements/maybe-full-page.js +1 -1
- package/dist/components/elements/sidebar-layout.js +1 -1
- package/dist/components/magic-link-sign-in.js +3 -3
- package/dist/components/message-cards/known-error-message-card.js +2 -2
- package/dist/components/message-cards/message-card.js +1 -1
- package/dist/components/message-cards/predefined-message-card.js +3 -3
- package/dist/components/oauth-button-group.js +2 -2
- package/dist/components/oauth-button.js +27 -16
- package/dist/components/oauth-button.js.map +1 -1
- package/dist/components/passkey-button.js +2 -2
- package/dist/components/profile-image-editor.js +87 -34
- package/dist/components/profile-image-editor.js.map +1 -1
- package/dist/components/selected-team-switcher.js +41 -9
- package/dist/components/selected-team-switcher.js.map +1 -1
- package/dist/components/{iframe-preventer.js → use-in-iframe.js} +9 -19
- package/dist/components/use-in-iframe.js.map +1 -0
- package/dist/components/user-button.js +41 -8
- package/dist/components/user-button.js.map +1 -1
- package/dist/components-page/account-settings/active-sessions/active-sessions-page.js +57 -12
- package/dist/components-page/account-settings/active-sessions/active-sessions-page.js.map +1 -1
- package/dist/components-page/account-settings/api-keys/api-keys-page.js +100 -12
- package/dist/components-page/account-settings/api-keys/api-keys-page.js.map +1 -1
- package/dist/components-page/account-settings/editable-text.js +1 -1
- package/dist/components-page/account-settings/email-and-auth/email-and-auth-page.js +12 -12
- package/dist/components-page/account-settings/email-and-auth/email-and-auth-page.js.map +1 -1
- package/dist/components-page/account-settings/email-and-auth/emails-section.js +14 -5
- package/dist/components-page/account-settings/email-and-auth/emails-section.js.map +1 -1
- package/dist/components-page/account-settings/email-and-auth/mfa-section.js +18 -5
- package/dist/components-page/account-settings/email-and-auth/mfa-section.js.map +1 -1
- package/dist/components-page/account-settings/email-and-auth/otp-section.js +18 -5
- package/dist/components-page/account-settings/email-and-auth/otp-section.js.map +1 -1
- package/dist/components-page/account-settings/email-and-auth/passkey-section.js +19 -6
- package/dist/components-page/account-settings/email-and-auth/passkey-section.js.map +1 -1
- package/dist/components-page/account-settings/email-and-auth/password-section.js +20 -7
- package/dist/components-page/account-settings/email-and-auth/password-section.js.map +1 -1
- package/dist/components-page/account-settings/profile-page/profile-page.js +18 -8
- package/dist/components-page/account-settings/profile-page/profile-page.js.map +1 -1
- package/dist/components-page/account-settings/settings/delete-account-section.js +19 -10
- package/dist/components-page/account-settings/settings/delete-account-section.js.map +1 -1
- package/dist/components-page/account-settings/settings/settings-page.js +6 -6
- package/dist/components-page/account-settings/settings/settings-page.js.map +1 -1
- package/dist/components-page/account-settings/settings/sign-out-section.js +15 -6
- package/dist/components-page/account-settings/settings/sign-out-section.js.map +1 -1
- package/dist/components-page/account-settings/teams/leave-team-section.js +3 -3
- package/dist/components-page/account-settings/teams/team-api-keys-section.js +5 -5
- package/dist/components-page/account-settings/teams/team-creation-page.js +19 -10
- package/dist/components-page/account-settings/teams/team-creation-page.js.map +1 -1
- package/dist/components-page/account-settings/teams/team-display-name-section.js +4 -4
- package/dist/components-page/account-settings/teams/team-member-invitation-section.js +4 -4
- package/dist/components-page/account-settings/teams/team-member-list-section.js +3 -3
- package/dist/components-page/account-settings/teams/team-page.js +8 -8
- package/dist/components-page/account-settings/teams/team-profile-image-section.js +4 -4
- package/dist/components-page/account-settings/teams/team-profile-user-section.js +4 -4
- package/dist/components-page/account-settings.js +29 -21
- package/dist/components-page/account-settings.js.map +1 -1
- package/dist/components-page/auth-page.js +11 -12
- package/dist/components-page/auth-page.js.map +1 -1
- package/dist/components-page/cli-auth-confirm.js +3 -3
- package/dist/components-page/email-verification.js +3 -3
- package/dist/components-page/error-page.js +6 -6
- package/dist/components-page/error-page.js.map +1 -1
- package/dist/components-page/forgot-password.js +6 -6
- package/dist/components-page/magic-link-callback.js +4 -4
- package/dist/components-page/mfa.js +190 -0
- package/dist/components-page/mfa.js.map +1 -0
- package/dist/components-page/oauth-callback.js +4 -4
- package/dist/components-page/password-reset.js +6 -6
- package/dist/components-page/sign-in.js +3 -2
- package/dist/components-page/sign-in.js.map +1 -1
- package/dist/components-page/sign-out.js +2 -2
- package/dist/components-page/sign-up.js +1 -1
- package/dist/components-page/stack-handler.js +25 -14
- package/dist/components-page/stack-handler.js.map +1 -1
- package/dist/components-page/team-creation.js +4 -4
- package/dist/components-page/team-invitation.js +3 -3
- package/dist/esm/components/api-key-dialogs.js +5 -4
- package/dist/esm/components/api-key-dialogs.js.map +1 -1
- package/dist/esm/components/credential-sign-in.js +4 -4
- package/dist/esm/components/credential-sign-up.js +3 -3
- package/dist/esm/components/elements/maybe-full-page.js +1 -1
- package/dist/esm/components/elements/sidebar-layout.js +1 -1
- package/dist/esm/components/magic-link-sign-in.js +3 -3
- package/dist/esm/components/message-cards/known-error-message-card.js +2 -2
- package/dist/esm/components/message-cards/message-card.js +1 -1
- package/dist/esm/components/message-cards/predefined-message-card.js +3 -3
- package/dist/esm/components/oauth-button-group.js +2 -2
- package/dist/esm/components/oauth-button.js +28 -17
- package/dist/esm/components/oauth-button.js.map +1 -1
- package/dist/esm/components/passkey-button.js +2 -2
- package/dist/esm/components/profile-image-editor.js +86 -34
- package/dist/esm/components/profile-image-editor.js.map +1 -1
- package/dist/esm/components/selected-team-switcher.js +41 -9
- package/dist/esm/components/selected-team-switcher.js.map +1 -1
- package/dist/esm/components/use-in-iframe.js +18 -0
- package/dist/esm/components/use-in-iframe.js.map +1 -0
- package/dist/esm/components/user-button.js +41 -8
- package/dist/esm/components/user-button.js.map +1 -1
- package/dist/esm/components-page/account-settings/active-sessions/active-sessions-page.js +57 -12
- package/dist/esm/components-page/account-settings/active-sessions/active-sessions-page.js.map +1 -1
- package/dist/esm/components-page/account-settings/api-keys/api-keys-page.js +100 -12
- package/dist/esm/components-page/account-settings/api-keys/api-keys-page.js.map +1 -1
- package/dist/esm/components-page/account-settings/editable-text.js +1 -1
- package/dist/esm/components-page/account-settings/email-and-auth/email-and-auth-page.js +12 -12
- package/dist/esm/components-page/account-settings/email-and-auth/email-and-auth-page.js.map +1 -1
- package/dist/esm/components-page/account-settings/email-and-auth/emails-section.js +14 -5
- package/dist/esm/components-page/account-settings/email-and-auth/emails-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/email-and-auth/mfa-section.js +18 -5
- package/dist/esm/components-page/account-settings/email-and-auth/mfa-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/email-and-auth/otp-section.js +18 -5
- package/dist/esm/components-page/account-settings/email-and-auth/otp-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/email-and-auth/passkey-section.js +19 -6
- package/dist/esm/components-page/account-settings/email-and-auth/passkey-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/email-and-auth/password-section.js +20 -7
- package/dist/esm/components-page/account-settings/email-and-auth/password-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/profile-page/profile-page.js +18 -8
- package/dist/esm/components-page/account-settings/profile-page/profile-page.js.map +1 -1
- package/dist/esm/components-page/account-settings/settings/delete-account-section.js +19 -10
- package/dist/esm/components-page/account-settings/settings/delete-account-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/settings/settings-page.js +6 -6
- package/dist/esm/components-page/account-settings/settings/settings-page.js.map +1 -1
- package/dist/esm/components-page/account-settings/settings/sign-out-section.js +15 -6
- package/dist/esm/components-page/account-settings/settings/sign-out-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/teams/leave-team-section.js +3 -3
- package/dist/esm/components-page/account-settings/teams/team-api-keys-section.js +5 -5
- package/dist/esm/components-page/account-settings/teams/team-creation-page.js +19 -10
- package/dist/esm/components-page/account-settings/teams/team-creation-page.js.map +1 -1
- package/dist/esm/components-page/account-settings/teams/team-display-name-section.js +4 -4
- package/dist/esm/components-page/account-settings/teams/team-member-invitation-section.js +4 -4
- package/dist/esm/components-page/account-settings/teams/team-member-list-section.js +3 -3
- package/dist/esm/components-page/account-settings/teams/team-page.js +8 -8
- package/dist/esm/components-page/account-settings/teams/team-profile-image-section.js +4 -4
- package/dist/esm/components-page/account-settings/teams/team-profile-user-section.js +4 -4
- package/dist/esm/components-page/account-settings.js +29 -21
- package/dist/esm/components-page/account-settings.js.map +1 -1
- package/dist/esm/components-page/auth-page.js +11 -12
- package/dist/esm/components-page/auth-page.js.map +1 -1
- package/dist/esm/components-page/cli-auth-confirm.js +3 -3
- package/dist/esm/components-page/email-verification.js +3 -3
- package/dist/esm/components-page/error-page.js +6 -6
- package/dist/esm/components-page/error-page.js.map +1 -1
- package/dist/esm/components-page/forgot-password.js +6 -6
- package/dist/esm/components-page/magic-link-callback.js +4 -4
- package/dist/esm/components-page/mfa.js +174 -0
- package/dist/esm/components-page/mfa.js.map +1 -0
- package/dist/esm/components-page/oauth-callback.js +4 -4
- package/dist/esm/components-page/password-reset.js +6 -6
- package/dist/esm/components-page/sign-in.js +3 -2
- package/dist/esm/components-page/sign-in.js.map +1 -1
- package/dist/esm/components-page/sign-out.js +2 -2
- package/dist/esm/components-page/sign-up.js +1 -1
- package/dist/esm/components-page/stack-handler.js +25 -14
- package/dist/esm/components-page/stack-handler.js.map +1 -1
- package/dist/esm/components-page/team-creation.js +4 -4
- package/dist/esm/components-page/team-invitation.js +3 -3
- package/dist/esm/generated/global-css.js +1 -1
- package/dist/esm/generated/global-css.js.map +1 -1
- package/dist/esm/generated/quetzal-translations.js +3574 -2364
- package/dist/esm/generated/quetzal-translations.js.map +1 -1
- package/dist/esm/index.js +22 -22
- package/dist/esm/lib/auth.js +2 -2
- package/dist/esm/lib/cookie.js +1 -129
- package/dist/esm/lib/cookie.js.map +1 -1
- package/dist/esm/lib/hooks.js +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.js +8 -8
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js +52 -21
- 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 +2 -1
- package/dist/esm/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/index.js +3 -3
- package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.js +8 -8
- package/dist/esm/lib/stack-app/apps/index.js +3 -3
- package/dist/esm/lib/stack-app/apps/interfaces/admin-app.js +1 -1
- package/dist/esm/lib/stack-app/apps/interfaces/client-app.js +1 -1
- package/dist/esm/lib/stack-app/apps/interfaces/client-app.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/interfaces/server-app.js +1 -1
- package/dist/esm/lib/stack-app/common.js.map +1 -1
- package/dist/esm/lib/stack-app/index.js +2 -2
- package/dist/esm/lib/stack-app/internal-api-keys/index.js.map +1 -1
- package/dist/esm/lib/translations.js +1 -1
- package/dist/esm/providers/stack-provider-client.js +2 -2
- package/dist/esm/providers/stack-provider.js +3 -3
- package/dist/esm/providers/theme-provider.js +3 -3
- package/dist/esm/providers/translation-provider.js +2 -2
- package/dist/esm/utils/browser-script.js +1 -1
- package/dist/generated/global-css.js +1 -1
- package/dist/generated/global-css.js.map +1 -1
- package/dist/generated/quetzal-translations.js +3574 -2364
- package/dist/generated/quetzal-translations.js.map +1 -1
- package/dist/index.d.mts +71 -2
- package/dist/index.d.ts +71 -2
- package/dist/index.js +23 -23
- package/dist/index.js.map +1 -1
- package/dist/lib/auth.js +2 -2
- package/dist/lib/cookie.js +4 -132
- package/dist/lib/cookie.js.map +1 -1
- package/dist/lib/hooks.js +1 -1
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.js +8 -8
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js +52 -21
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/common.js +2 -1
- package/dist/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/index.js +3 -3
- package/dist/lib/stack-app/apps/implementations/server-app-impl.js +8 -8
- package/dist/lib/stack-app/apps/index.js +3 -3
- package/dist/lib/stack-app/apps/interfaces/admin-app.js +1 -1
- package/dist/lib/stack-app/apps/interfaces/client-app.js +1 -1
- package/dist/lib/stack-app/apps/interfaces/client-app.js.map +1 -1
- package/dist/lib/stack-app/apps/interfaces/server-app.js +1 -1
- package/dist/lib/stack-app/common.js.map +1 -1
- package/dist/lib/stack-app/index.js +2 -2
- package/dist/lib/stack-app/internal-api-keys/index.js.map +1 -1
- package/dist/lib/translations.js +1 -1
- package/dist/providers/stack-provider-client.js +2 -2
- package/dist/providers/stack-provider.js +3 -3
- package/dist/providers/theme-provider.js +3 -3
- package/dist/providers/translation-provider.js +2 -2
- package/dist/utils/browser-script.js +1 -1
- package/package.json +5 -5
- package/dist/components/iframe-preventer.js.map +0 -1
- package/dist/esm/components/iframe-preventer.js +0 -28
- package/dist/esm/components/iframe-preventer.js.map +0 -1
|
@@ -15,19 +15,19 @@ import { deindent, mergeScopeStrings } from "@stackframe/stack-shared/dist/utils
|
|
|
15
15
|
import { getRelativePart, isRelative } from "@stackframe/stack-shared/dist/utils/urls";
|
|
16
16
|
import { generateUuid } from "@stackframe/stack-shared/dist/utils/uuids";
|
|
17
17
|
import * as cookie from "cookie";
|
|
18
|
-
import { constructRedirectUrl } from "../../../../utils/url";
|
|
19
|
-
import { addNewOAuthProviderOrScope, callOAuthCallback, signInWithOAuth } from "../../../auth";
|
|
20
|
-
import { createBrowserCookieHelper, createCookieHelper, createPlaceholderCookieHelper, deleteCookieClient, getCookieClient, setOrDeleteCookie, setOrDeleteCookieClient } from "../../../cookie";
|
|
21
|
-
import { apiKeyCreationOptionsToCrud } from "../../api-keys";
|
|
22
|
-
import { stackAppInternalsSymbol } from "../../common";
|
|
23
|
-
import { contactChannelCreateOptionsToCrud, contactChannelUpdateOptionsToCrud } from "../../contact-channels";
|
|
24
|
-
import { adminProjectCreateOptionsToCrud } from "../../projects";
|
|
25
|
-
import { teamCreateOptionsToCrud, teamUpdateOptionsToCrud } from "../../teams";
|
|
26
|
-
import { userUpdateOptionsToCrud } from "../../users";
|
|
27
|
-
import { clientVersion, createCache, createCacheBySession, createEmptyTokenStore, getBaseUrl, getDefaultExtraRequestHeaders, getDefaultProjectId, getDefaultPublishableClientKey, getUrls } from "./common";
|
|
18
|
+
import { constructRedirectUrl } from "../../../../utils/url.js";
|
|
19
|
+
import { addNewOAuthProviderOrScope, callOAuthCallback, signInWithOAuth } from "../../../auth.js";
|
|
20
|
+
import { createBrowserCookieHelper, createCookieHelper, createPlaceholderCookieHelper, deleteCookieClient, getCookieClient, setOrDeleteCookie, setOrDeleteCookieClient } from "../../../cookie.js";
|
|
21
|
+
import { apiKeyCreationOptionsToCrud } from "../../api-keys/index.js";
|
|
22
|
+
import { stackAppInternalsSymbol } from "../../common.js";
|
|
23
|
+
import { contactChannelCreateOptionsToCrud, contactChannelUpdateOptionsToCrud } from "../../contact-channels/index.js";
|
|
24
|
+
import { adminProjectCreateOptionsToCrud } from "../../projects/index.js";
|
|
25
|
+
import { teamCreateOptionsToCrud, teamUpdateOptionsToCrud } from "../../teams/index.js";
|
|
26
|
+
import { userUpdateOptionsToCrud } from "../../users/index.js";
|
|
27
|
+
import { clientVersion, createCache, createCacheBySession, createEmptyTokenStore, getBaseUrl, getDefaultExtraRequestHeaders, getDefaultProjectId, getDefaultPublishableClientKey, getUrls } from "./common.js";
|
|
28
28
|
import * as NextNavigationUnscrambled from "next/navigation";
|
|
29
29
|
import React, { useCallback, useMemo } from "react";
|
|
30
|
-
import { useAsyncCache } from "./common";
|
|
30
|
+
import { useAsyncCache } from "./common.js";
|
|
31
31
|
import * as sc from "@stackframe/stack-sc";
|
|
32
32
|
import { cookies } from "@stackframe/stack-sc";
|
|
33
33
|
var isReactServer2 = false;
|
|
@@ -1067,6 +1067,9 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
|
|
|
1067
1067
|
async redirectToTeamInvitation(options) {
|
|
1068
1068
|
return await this._redirectToHandler("teamInvitation", options);
|
|
1069
1069
|
}
|
|
1070
|
+
async redirectToMfa(options) {
|
|
1071
|
+
return await this._redirectToHandler("mfa", options);
|
|
1072
|
+
}
|
|
1070
1073
|
async sendForgotPasswordEmail(email, options) {
|
|
1071
1074
|
return await this._interface.sendForgotPasswordEmail(email, options?.callbackUrl ?? constructRedirectUrl(this.urls.passwordReset, "callbackUrl"));
|
|
1072
1075
|
}
|
|
@@ -1203,19 +1206,14 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
|
|
|
1203
1206
|
);
|
|
1204
1207
|
}
|
|
1205
1208
|
/**
|
|
1206
|
-
*
|
|
1207
|
-
* TODO remove
|
|
1209
|
+
* Handles MFA verification by redirecting to the OTP page
|
|
1208
1210
|
*/
|
|
1209
1211
|
async _experimentalMfa(error, session) {
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
throw new KnownErrors.InvalidTotpCode();
|
|
1212
|
+
if (typeof window !== "undefined") {
|
|
1213
|
+
window.sessionStorage.setItem("stack_mfa_attempt_code", error.details?.attempt_code ?? throwErr("attempt code missing"));
|
|
1213
1214
|
}
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
otp,
|
|
1217
|
-
session
|
|
1218
|
-
);
|
|
1215
|
+
await this.redirectToMfa();
|
|
1216
|
+
throw new StackAssertionError("we should have redirected in redirectToMfa()");
|
|
1219
1217
|
}
|
|
1220
1218
|
/**
|
|
1221
1219
|
* @deprecated
|
|
@@ -1399,6 +1397,39 @@ ${url}`);
|
|
|
1399
1397
|
}
|
|
1400
1398
|
return Result.error(new KnownErrors.CliAuthError("Timed out waiting for CLI authentication."));
|
|
1401
1399
|
}
|
|
1400
|
+
/*
|
|
1401
|
+
* Completes the MFA sign-in process by verifying the provided OTP code
|
|
1402
|
+
* @param totp The TOTP (Time-based One-Time Password) provided by the user
|
|
1403
|
+
* @param code The Attempt code provided by the user
|
|
1404
|
+
* @param options Additional options for the sign-in process
|
|
1405
|
+
* @returns A Result indicating success or failure
|
|
1406
|
+
*/
|
|
1407
|
+
async signInWithMfa(totp, code, options) {
|
|
1408
|
+
this._ensurePersistentTokenStore();
|
|
1409
|
+
let result;
|
|
1410
|
+
try {
|
|
1411
|
+
result = await this._catchMfaRequiredError(async () => {
|
|
1412
|
+
return await this._interface.signInWithMfa(totp, code);
|
|
1413
|
+
});
|
|
1414
|
+
} catch (e) {
|
|
1415
|
+
if (e instanceof KnownErrors.InvalidTotpCode) {
|
|
1416
|
+
return Result.error(e);
|
|
1417
|
+
}
|
|
1418
|
+
throw e;
|
|
1419
|
+
}
|
|
1420
|
+
if (result.status === "ok") {
|
|
1421
|
+
await this._signInToAccountWithTokens(result.data);
|
|
1422
|
+
if (!options?.noRedirect) {
|
|
1423
|
+
if (result.data.newUser) {
|
|
1424
|
+
await this.redirectToAfterSignUp({ replace: true });
|
|
1425
|
+
} else {
|
|
1426
|
+
await this.redirectToAfterSignIn({ replace: true });
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
return Result.ok(void 0);
|
|
1430
|
+
}
|
|
1431
|
+
return Result.error(result.error);
|
|
1432
|
+
}
|
|
1402
1433
|
async signInWithPasskey() {
|
|
1403
1434
|
this._ensurePersistentTokenStore();
|
|
1404
1435
|
const session = await this._getSession();
|