@8wave/ai-elements 0.114.0-beta.7 → 0.114.0-beta.8

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/dist-vue/index.js CHANGED
@@ -679,7 +679,7 @@ var ca = oa, la = { class: "flex items-center gap-4 mb-4" }, ua = { class: "font
679
679
  }
680
680
  });
681
681
  //#endregion
682
- //#region virtual:intlify-i18n-3
682
+ //#region virtual:intlify-i18n-2
683
683
  function ga(e) {
684
684
  let t = e;
685
685
  t.__i18n = t.__i18n || [], t.__i18n.push({
@@ -16306,7 +16306,7 @@ var uC = /*#__PURE__*/ sC(cC, [["render", lC]]), dC = {
16306
16306
  }
16307
16307
  });
16308
16308
  //#endregion
16309
- //#region virtual:intlify-i18n-2
16309
+ //#region virtual:intlify-i18n-3
16310
16310
  function bC(e) {
16311
16311
  let t = e;
16312
16312
  t.__i18n = t.__i18n || [], t.__i18n.push({
@@ -1,22 +1,28 @@
1
1
  import { BetterAuthPlugin } from 'better-auth';
2
2
  /**
3
- * Backs the widget social-login OAuth popup flow end to end.
3
+ * Whether `value` is exactly one of the trusted origins: a bare origin, listed
4
+ * as it is. better-auth matches its trusted origins as patterns, so an agent
5
+ * whose trusted origins hold `*` would let any page through; the CORS plugin
6
+ * (apps/backend/src/plugins/fastifyCors.ts) compares them exactly, and a widget
7
+ * whose host it refuses cannot run anyway.
8
+ */
9
+ export declare function isListedOrigin(value: string, trusted: string[]): boolean;
10
+ /**
11
+ * Backs the social sign-in that runs in a browser window on the backend origin.
4
12
  *
5
13
  * `socialRedirect` initiates the flow through a top-level GET navigation instead
6
14
  * of the default `POST /sign-in/social` XHR call. Better-auth's social sign-in
7
15
  * sets a signed `state` cookie that the OAuth callback verifies (CSRF
8
- * protection). When the flow is started from an XHR on a different origin (e.g.
9
- * the embeddable widget, or any cross-site context), that `Set-Cookie` is a
10
- * third-party cookie and modern browsers drop it, so the callback fails with
11
- * `state_mismatch`. By navigating the browser (popup or full page) directly to
16
+ * protection). When the flow is started from an XHR on a different origin, that
17
+ * `Set-Cookie` is a third-party cookie and modern browsers drop it, so the
18
+ * callback fails with `state_mismatch`. By navigating the browser directly to
12
19
  * this endpoint on the backend origin, the `state` cookie is set first-party and
13
- * survives, both in development and in production on customer domains. It mirrors
14
- * the redirect branch of core `signInSocial`, reusing `generateState` so the
15
- * stored state stays compatible with the standard OAuth callback.
20
+ * survives. It mirrors the redirect branch of core `signInSocial`, reusing
21
+ * `generateState` so the stored state stays compatible with the standard OAuth
22
+ * callback. The frontend uses it; the widget's popup uses `oauthPopup`, whose
23
+ * callback hands back the token of the session it just created, and only to the
24
+ * origin that started it.
16
25
  *
17
- * `widgetOAuthCallback` is the landing page the popup ends on after the OAuth
18
- * callback completes (it's the `callbackURL` passed to `socialRedirect`). It runs
19
- * on the backend origin so it can read the first-party session cookie and post the
20
- * Bearer token back to the widget opener.
26
+ * The before hook narrows the origin `oauthPopup` accepts to the listed ones.
21
27
  */
22
28
  export declare function socialRedirect(): BetterAuthPlugin;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8wave/ai-elements",
3
3
  "private": false,
4
- "version": "0.114.0-beta.7",
4
+ "version": "0.114.0-beta.8",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite --port 8082 --open --host",