@wix/astro 1.0.17 → 1.0.19

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.
@@ -0,0 +1,7 @@
1
+ // src/utils/authAsyncLocalStorage.ts
2
+ import { AsyncLocalStorage } from "node:async_hooks";
3
+ var authAsyncLocalStorage = new AsyncLocalStorage();
4
+
5
+ export {
6
+ authAsyncLocalStorage
7
+ };
@@ -0,0 +1,18 @@
1
+ // src/utils/saveSessionTokensToCookie.ts
2
+ import { WIX_CLIENT_ID } from "astro:env/client";
3
+ function sessionCookieJson(tokens) {
4
+ return {
5
+ clientId: WIX_CLIENT_ID,
6
+ tokens
7
+ };
8
+ }
9
+ function saveSessionTokensToCookie(context, tokens) {
10
+ context.cookies.set("wixSession", sessionCookieJson(tokens), {
11
+ path: "/",
12
+ secure: true
13
+ });
14
+ }
15
+
16
+ export {
17
+ saveSessionTokensToCookie
18
+ };
@@ -0,0 +1,13 @@
1
+ // src/constants.ts
2
+ var oAuthStateCookieName = "oAuthState";
3
+ var returnToQueryParamName = "returnTo";
4
+
5
+ // src/utils/contextualAuth.ts
6
+ import { auth as originalAuth } from "@wix/essentials";
7
+ var auth = originalAuth.getContextualAuth();
8
+
9
+ export {
10
+ oAuthStateCookieName,
11
+ returnToQueryParamName,
12
+ auth
13
+ };