@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/ai-elements.es.js +545 -556
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/apps/web-component/src/composables/useChatbotAuth.d.ts +1 -3
- package/dist-vue/composables.js +77 -88
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +2 -2
- package/dist-vue/packages/auth/src/social-redirect-plugin.d.ts +18 -12
- package/package.json +1 -1
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-
|
|
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-
|
|
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
|
-
*
|
|
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
|
|
9
|
-
*
|
|
10
|
-
*
|
|
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
|
|
14
|
-
* the
|
|
15
|
-
*
|
|
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
|
-
*
|
|
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;
|