@stackframe/stack 2.8.11 → 2.8.12

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.
Files changed (66) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/components/magic-link-sign-in.js +3 -3
  3. package/dist/components/magic-link-sign-in.js.map +1 -1
  4. package/dist/components-page/account-settings/email-and-auth/emails-section.js +1 -1
  5. package/dist/components-page/account-settings/email-and-auth/emails-section.js.map +1 -1
  6. package/dist/components-page/account-settings/teams/team-api-keys-section.js +4 -1
  7. package/dist/components-page/account-settings/teams/team-api-keys-section.js.map +1 -1
  8. package/dist/components-page/account-settings/teams/team-member-list-section.js +4 -1
  9. package/dist/components-page/account-settings/teams/team-member-list-section.js.map +1 -1
  10. package/dist/components-page/auth-page.js +5 -5
  11. package/dist/components-page/auth-page.js.map +1 -1
  12. package/dist/components-page/email-verification.js +3 -3
  13. package/dist/components-page/email-verification.js.map +1 -1
  14. package/dist/components-page/error-page.js +3 -3
  15. package/dist/components-page/error-page.js.map +1 -1
  16. package/dist/components-page/magic-link-callback.js +3 -3
  17. package/dist/components-page/magic-link-callback.js.map +1 -1
  18. package/dist/components-page/password-reset.js +3 -3
  19. package/dist/components-page/password-reset.js.map +1 -1
  20. package/dist/components-page/team-invitation.js +3 -3
  21. package/dist/components-page/team-invitation.js.map +1 -1
  22. package/dist/esm/components/magic-link-sign-in.js +3 -3
  23. package/dist/esm/components/magic-link-sign-in.js.map +1 -1
  24. package/dist/esm/components-page/account-settings/email-and-auth/emails-section.js +1 -1
  25. package/dist/esm/components-page/account-settings/email-and-auth/emails-section.js.map +1 -1
  26. package/dist/esm/components-page/account-settings/teams/team-api-keys-section.js +5 -2
  27. package/dist/esm/components-page/account-settings/teams/team-api-keys-section.js.map +1 -1
  28. package/dist/esm/components-page/account-settings/teams/team-member-list-section.js +4 -1
  29. package/dist/esm/components-page/account-settings/teams/team-member-list-section.js.map +1 -1
  30. package/dist/esm/components-page/auth-page.js +5 -5
  31. package/dist/esm/components-page/auth-page.js.map +1 -1
  32. package/dist/esm/components-page/email-verification.js +3 -3
  33. package/dist/esm/components-page/email-verification.js.map +1 -1
  34. package/dist/esm/components-page/error-page.js +3 -3
  35. package/dist/esm/components-page/error-page.js.map +1 -1
  36. package/dist/esm/components-page/magic-link-callback.js +3 -3
  37. package/dist/esm/components-page/magic-link-callback.js.map +1 -1
  38. package/dist/esm/components-page/password-reset.js +3 -3
  39. package/dist/esm/components-page/password-reset.js.map +1 -1
  40. package/dist/esm/components-page/team-invitation.js +3 -3
  41. package/dist/esm/components-page/team-invitation.js.map +1 -1
  42. package/dist/esm/generated/global-css.js +1 -1
  43. package/dist/esm/generated/global-css.js.map +1 -1
  44. package/dist/esm/lib/auth.js +1 -1
  45. package/dist/esm/lib/auth.js.map +1 -1
  46. package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js +5 -5
  47. package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
  48. package/dist/esm/lib/stack-app/apps/implementations/common.js +1 -1
  49. package/dist/esm/lib/stack-app/apps/implementations/common.js.map +1 -1
  50. package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.js +27 -9
  51. package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.js.map +1 -1
  52. package/dist/esm/lib/stack-app/users/index.js.map +1 -1
  53. package/dist/generated/global-css.js +1 -1
  54. package/dist/generated/global-css.js.map +1 -1
  55. package/dist/index.d.mts +2 -0
  56. package/dist/index.d.ts +2 -0
  57. package/dist/lib/auth.js +1 -1
  58. package/dist/lib/auth.js.map +1 -1
  59. package/dist/lib/stack-app/apps/implementations/client-app-impl.js +5 -5
  60. package/dist/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
  61. package/dist/lib/stack-app/apps/implementations/common.js +1 -1
  62. package/dist/lib/stack-app/apps/implementations/common.js.map +1 -1
  63. package/dist/lib/stack-app/apps/implementations/server-app-impl.js +27 -9
  64. package/dist/lib/stack-app/apps/implementations/server-app-impl.js.map +1 -1
  65. package/dist/lib/stack-app/users/index.js.map +1 -1
  66. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/auth.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nimport { KnownError, StackClientInterface } from \"@stackframe/stack-shared\";\nimport { InternalSession } from \"@stackframe/stack-shared/dist/sessions\";\nimport { StackAssertionError, throwErr } from \"@stackframe/stack-shared/dist/utils/errors\";\nimport { neverResolve } from \"@stackframe/stack-shared/dist/utils/promises\";\nimport { Result } from \"@stackframe/stack-shared/dist/utils/results\";\nimport { deindent } from \"@stackframe/stack-shared/dist/utils/strings\";\nimport { constructRedirectUrl } from \"../utils/url\";\nimport { consumeVerifierAndStateCookie, saveVerifierAndState } from \"./cookie\";\n\nexport async function signInWithOAuth(\n iface: StackClientInterface,\n options: {\n provider: string,\n redirectUrl: string,\n errorRedirectUrl: string,\n providerScope?: string,\n }\n) {\n const { codeChallenge, state } = await saveVerifierAndState();\n const location = await iface.getOAuthUrl({\n provider: options.provider,\n redirectUrl: constructRedirectUrl(options.redirectUrl, \"redirectUrl\"),\n errorRedirectUrl: constructRedirectUrl(options.errorRedirectUrl, \"errorRedirectUrl\"),\n codeChallenge,\n state,\n type: \"authenticate\",\n providerScope: options.providerScope,\n });\n window.location.assign(location);\n await neverResolve();\n}\n\nexport async function addNewOAuthProviderOrScope(\n iface: StackClientInterface,\n options: {\n provider: string,\n redirectUrl: string,\n errorRedirectUrl: string,\n providerScope?: string,\n },\n session: InternalSession,\n) {\n const { codeChallenge, state } = await saveVerifierAndState();\n const location = await iface.getOAuthUrl({\n provider: options.provider,\n redirectUrl: constructRedirectUrl(options.redirectUrl, \"redirectUrl\"),\n errorRedirectUrl: constructRedirectUrl(options.errorRedirectUrl, \"errorRedirectUrl\"),\n afterCallbackRedirectUrl: constructRedirectUrl(window.location.href, \"afterCallbackRedirectUrl\"),\n codeChallenge,\n state,\n type: \"link\",\n session,\n providerScope: options.providerScope,\n });\n window.location.assign(location);\n await neverResolve();\n}\n\n/**\n * Checks if the current URL has the query parameters for an OAuth callback, and if so, removes them.\n *\n * Must be synchronous for the logic in callOAuthCallback to work without race conditions.\n */\nfunction consumeOAuthCallbackQueryParams() {\n const requiredParams = [\"code\", \"state\"];\n const originalUrl = new URL(window.location.href);\n for (const param of requiredParams) {\n if (!originalUrl.searchParams.has(param)) {\n console.warn(new Error(`Missing required query parameter on OAuth callback: ${param}. Maybe you opened or reloaded the oauth-callback page from your history?`));\n return null;\n }\n }\n\n const expectedState = originalUrl.searchParams.get(\"state\") ?? throwErr(\"This should never happen; isn't state required above?\");\n const cookieResult = consumeVerifierAndStateCookie(expectedState);\n\n if (!cookieResult) {\n // If the state can't be found in the cookies, then the callback wasn't meant for us.\n // Maybe the website uses another OAuth library?\n console.warn(deindent`\n Stack found an outer OAuth callback state in the query parameters, but not in cookies.\n \n This could have multiple reasons:\n - The cookie expired, because the OAuth flow took too long.\n - The user's browser deleted the cookie, either manually or because of a very strict cookie policy.\n - The cookie was already consumed by this page, and the user already logged in.\n - You are using another OAuth client library with the same callback URL as Stack.\n - The user opened the OAuth callback page from their history.\n\n Either way, it is probably safe to ignore this warning unless you are debugging an OAuth issue.\n `);\n return null;\n }\n\n\n const newUrl = new URL(originalUrl);\n for (const param of requiredParams) {\n newUrl.searchParams.delete(param);\n }\n\n // let's get rid of the authorization code in the history as we\n // don't redirect to `redirectUrl` if there's a validation error\n // (as the redirectUrl might be malicious!).\n //\n // We use history.replaceState instead of location.assign(...) to\n // prevent an unnecessary reload\n window.history.replaceState({}, \"\", newUrl.toString());\n\n return {\n originalUrl,\n codeVerifier: cookieResult.codeVerifier,\n state: expectedState,\n };\n}\n\nexport async function callOAuthCallback(\n iface: StackClientInterface,\n redirectUrl: string,\n) {\n // note: this part of the function (until the return) needs\n // to be synchronous, to prevent race conditions when\n // callOAuthCallback is called multiple times in parallel\n const consumed = consumeOAuthCallbackQueryParams();\n if (!consumed) return Result.ok(undefined);\n\n // the rest can be asynchronous (we now know that we are the\n // intended recipient of the callback, and the only instance\n // of callOAuthCallback that's running)\n try {\n return Result.ok(await iface.callOAuthCallback({\n oauthParams: consumed.originalUrl.searchParams,\n redirectUri: constructRedirectUrl(redirectUrl, \"redirectUri\"),\n codeVerifier: consumed.codeVerifier,\n state: consumed.state,\n }));\n } catch (e) {\n if (e instanceof KnownError) {\n throw e;\n }\n throw new StackAssertionError(\"Error signing in during OAuth callback. Please try again.\", { cause: e });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,0BAAiD;AAEjD,oBAA8C;AAC9C,sBAA6B;AAC7B,qBAAuB;AACvB,qBAAyB;AACzB,iBAAqC;AACrC,oBAAoE;AAEpE,eAAsB,gBACpB,OACA,SAMA;AACA,QAAM,EAAE,eAAe,MAAM,IAAI,UAAM,oCAAqB;AAC5D,QAAM,WAAW,MAAM,MAAM,YAAY;AAAA,IACvC,UAAU,QAAQ;AAAA,IAClB,iBAAa,iCAAqB,QAAQ,aAAa,aAAa;AAAA,IACpE,sBAAkB,iCAAqB,QAAQ,kBAAkB,kBAAkB;AAAA,IACnF;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN,eAAe,QAAQ;AAAA,EACzB,CAAC;AACD,SAAO,SAAS,OAAO,QAAQ;AAC/B,YAAM,8BAAa;AACrB;AAEA,eAAsB,2BACpB,OACA,SAMA,SACA;AACA,QAAM,EAAE,eAAe,MAAM,IAAI,UAAM,oCAAqB;AAC5D,QAAM,WAAW,MAAM,MAAM,YAAY;AAAA,IACvC,UAAU,QAAQ;AAAA,IAClB,iBAAa,iCAAqB,QAAQ,aAAa,aAAa;AAAA,IACpE,sBAAkB,iCAAqB,QAAQ,kBAAkB,kBAAkB;AAAA,IACnF,8BAA0B,iCAAqB,OAAO,SAAS,MAAM,0BAA0B;AAAA,I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AS,GAAG;AACV,QAAI,aAAa,gCAAY;AAC3B,YAAM;AAAA,IACR;AACA,UAAM,IAAI,kCAAoB,6DAA6D,EAAE,OAAO,EAAE,CAAC;AAAA,EACzG;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/lib/auth.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nimport { KnownError, StackClientInterface } from \"@stackframe/stack-shared\";\nimport { InternalSession } from \"@stackframe/stack-shared/dist/sessions\";\nimport { StackAssertionError, throwErr } from \"@stackframe/stack-shared/dist/utils/errors\";\nimport { neverResolve } from \"@stackframe/stack-shared/dist/utils/promises\";\nimport { Result } from \"@stackframe/stack-shared/dist/utils/results\";\nimport { deindent } from \"@stackframe/stack-shared/dist/utils/strings\";\nimport { constructRedirectUrl } from \"../utils/url\";\nimport { consumeVerifierAndStateCookie, saveVerifierAndState } from \"./cookie\";\n\nexport async function signInWithOAuth(\n iface: StackClientInterface,\n options: {\n provider: string,\n redirectUrl: string,\n errorRedirectUrl: string,\n providerScope?: string,\n }\n) {\n const { codeChallenge, state } = await saveVerifierAndState();\n const location = await iface.getOAuthUrl({\n provider: options.provider,\n redirectUrl: constructRedirectUrl(options.redirectUrl, \"redirectUrl\"),\n errorRedirectUrl: constructRedirectUrl(options.errorRedirectUrl, \"errorRedirectUrl\"),\n codeChallenge,\n state,\n type: \"authenticate\",\n providerScope: options.providerScope,\n });\n window.location.assign(location);\n await neverResolve();\n}\n\nexport async function addNewOAuthProviderOrScope(\n iface: StackClientInterface,\n options: {\n provider: string,\n redirectUrl: string,\n errorRedirectUrl: string,\n providerScope?: string,\n },\n session: InternalSession,\n) {\n const { codeChallenge, state } = await saveVerifierAndState();\n const location = await iface.getOAuthUrl({\n provider: options.provider,\n redirectUrl: constructRedirectUrl(options.redirectUrl, \"redirectUrl\"),\n errorRedirectUrl: constructRedirectUrl(options.errorRedirectUrl, \"errorRedirectUrl\"),\n afterCallbackRedirectUrl: constructRedirectUrl(window.location.href, \"afterCallbackRedirectUrl\"),\n codeChallenge,\n state,\n type: \"link\",\n session,\n providerScope: options.providerScope,\n });\n window.location.assign(location);\n await neverResolve();\n}\n\n/**\n * Checks if the current URL has the query parameters for an OAuth callback, and if so, removes them.\n *\n * Must be synchronous for the logic in callOAuthCallback to work without race conditions.\n */\nfunction consumeOAuthCallbackQueryParams() {\n const requiredParams = [\"code\", \"state\"];\n const originalUrl = new URL(window.location.href);\n for (const param of requiredParams) {\n if (!originalUrl.searchParams.has(param)) {\n console.warn(new Error(`Missing required query parameter on OAuth callback: ${param}. Maybe you opened or reloaded the oauth-callback page from your history?`));\n return null;\n }\n }\n\n const expectedState = originalUrl.searchParams.get(\"state\") ?? throwErr(\"This should never happen; isn't state required above?\");\n const cookieResult = consumeVerifierAndStateCookie(expectedState);\n\n if (!cookieResult) {\n // If the state can't be found in the cookies, then the callback wasn't meant for us.\n // Maybe the website uses another OAuth library?\n console.warn(deindent`\n Stack found an outer OAuth callback state in the query parameters, but not in cookies.\n \n This could have multiple reasons:\n - The cookie expired, because the OAuth flow took too long.\n - The user's browser deleted the cookie, either manually or because of a very strict cookie policy.\n - The cookie was already consumed by this page, and the user already logged in.\n - You are using another OAuth client library with the same callback URL as Stack.\n - The user opened the OAuth callback page from their history.\n\n Either way, it is probably safe to ignore this warning unless you are debugging an OAuth issue.\n `);\n return null;\n }\n\n\n const newUrl = new URL(originalUrl);\n for (const param of requiredParams) {\n newUrl.searchParams.delete(param);\n }\n\n // let's get rid of the authorization code in the history as we\n // don't redirect to `redirectUrl` if there's a validation error\n // (as the redirectUrl might be malicious!).\n //\n // We use history.replaceState instead of location.assign(...) to\n // prevent an unnecessary reload\n window.history.replaceState({}, \"\", newUrl.toString());\n\n return {\n originalUrl,\n codeVerifier: cookieResult.codeVerifier,\n state: expectedState,\n };\n}\n\nexport async function callOAuthCallback(\n iface: StackClientInterface,\n redirectUrl: string,\n) {\n // note: this part of the function (until the return) needs\n // to be synchronous, to prevent race conditions when\n // callOAuthCallback is called multiple times in parallel\n const consumed = consumeOAuthCallbackQueryParams();\n if (!consumed) return Result.ok(undefined);\n\n // the rest can be asynchronous (we now know that we are the\n // intended recipient of the callback, and the only instance\n // of callOAuthCallback that's running)\n try {\n return Result.ok(await iface.callOAuthCallback({\n oauthParams: consumed.originalUrl.searchParams,\n redirectUri: constructRedirectUrl(redirectUrl, \"redirectUri\"),\n codeVerifier: consumed.codeVerifier,\n state: consumed.state,\n }));\n } catch (e) {\n if (KnownError.isKnownError(e)) {\n throw e;\n }\n throw new StackAssertionError(\"Error signing in during OAuth callback. Please try again.\", { cause: e });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,0BAAiD;AAEjD,oBAA8C;AAC9C,sBAA6B;AAC7B,qBAAuB;AACvB,qBAAyB;AACzB,iBAAqC;AACrC,oBAAoE;AAEpE,eAAsB,gBACpB,OACA,SAMA;AACA,QAAM,EAAE,eAAe,MAAM,IAAI,UAAM,oCAAqB;AAC5D,QAAM,WAAW,MAAM,MAAM,YAAY;AAAA,IACvC,UAAU,QAAQ;AAAA,IAClB,iBAAa,iCAAqB,QAAQ,aAAa,aAAa;AAAA,IACpE,sBAAkB,iCAAqB,QAAQ,kBAAkB,kBAAkB;AAAA,IACnF;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN,eAAe,QAAQ;AAAA,EACzB,CAAC;AACD,SAAO,SAAS,OAAO,QAAQ;AAC/B,YAAM,8BAAa;AACrB;AAEA,eAAsB,2BACpB,OACA,SAMA,SACA;AACA,QAAM,EAAE,eAAe,MAAM,IAAI,UAAM,oCAAqB;AAC5D,QAAM,WAAW,MAAM,MAAM,YAAY;AAAA,IACvC,UAAU,QAAQ;AAAA,IAClB,iBAAa,iCAAqB,QAAQ,aAAa,aAAa;AAAA,IACpE,sBAAkB,iCAAqB,QAAQ,kBAAkB,kBAAkB;AA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AA,MACvB,OAAO,SAAS;AAAA,IAClB,CAAC,CAAC;AAAA,EACJ,SAAS,GAAG;AACV,QAAI,+BAAW,aAAa,CAAC,GAAG;AAC9B,YAAM;AAAA,IACR;AACA,UAAM,IAAI,kCAAoB,6DAA6D,EAAE,OAAO,EAAE,CAAC;AAAA,EACzG;AACF;","names":[]}
@@ -104,7 +104,7 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
104
104
  const result = await this._interface.createProviderAccessToken(providerId, scope || "", session);
105
105
  return { accessToken: result.access_token };
106
106
  } catch (err) {
107
- if (!(err instanceof import_stack_shared.KnownErrors.OAuthConnectionDoesNotHaveRequiredScope || err instanceof import_stack_shared.KnownErrors.OAuthConnectionNotConnectedToUser)) {
107
+ if (!(import_stack_shared.KnownErrors.OAuthConnectionDoesNotHaveRequiredScope.isInstance(err) || import_stack_shared.KnownErrors.OAuthConnectionNotConnectedToUser.isInstance(err))) {
108
108
  throw err;
109
109
  }
110
110
  }
@@ -1259,7 +1259,7 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
1259
1259
  try {
1260
1260
  return await callback();
1261
1261
  } catch (e) {
1262
- if (e instanceof import_stack_shared.KnownErrors.MultiFactorAuthenticationRequired) {
1262
+ if (import_stack_shared.KnownErrors.MultiFactorAuthenticationRequired.isInstance(e)) {
1263
1263
  return import_results.Result.ok(await this._experimentalMfa(e, await this._getSession()));
1264
1264
  }
1265
1265
  throw e;
@@ -1274,7 +1274,7 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
1274
1274
  return await this._interface.signInWithCredential(options.email, options.password, session);
1275
1275
  });
1276
1276
  } catch (e) {
1277
- if (e instanceof import_stack_shared.KnownErrors.InvalidTotpCode) {
1277
+ if (import_stack_shared.KnownErrors.InvalidTotpCode.isInstance(e)) {
1278
1278
  return import_results.Result.error(e);
1279
1279
  }
1280
1280
  throw e;
@@ -1335,7 +1335,7 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
1335
1335
  return await this._interface.signInWithMagicLink(code);
1336
1336
  });
1337
1337
  } catch (e) {
1338
- if (e instanceof import_stack_shared.KnownErrors.InvalidTotpCode) {
1338
+ if (import_stack_shared.KnownErrors.InvalidTotpCode.isInstance(e)) {
1339
1339
  return import_results.Result.error(e);
1340
1340
  }
1341
1341
  throw e;
@@ -1477,7 +1477,7 @@ ${url}`);
1477
1477
  return await (0, import_auth.callOAuthCallback)(this._interface, this.urls.oauthCallback);
1478
1478
  });
1479
1479
  } catch (e) {
1480
- if (e instanceof import_stack_shared.KnownErrors.InvalidTotpCode) {
1480
+ if (import_stack_shared.KnownErrors.InvalidTotpCode.isInstance(e)) {
1481
1481
  alert("Invalid TOTP code. Please try signing in again.");
1482
1482
  return false;
1483
1483
  } else {