@wix/astro 1.0.28 → 1.0.30
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.
|
@@ -1075,7 +1075,7 @@ var onOAuthAppUpdated2 = createEventModule(onOAuthAppUpdated);
|
|
|
1075
1075
|
// src/routes/paylink/paylink.ts
|
|
1076
1076
|
import { auth } from "@wix/essentials";
|
|
1077
1077
|
import { WIX_CLIENT_ID } from "astro:env/client";
|
|
1078
|
-
var GET = async ({
|
|
1078
|
+
var GET = async ({ params }) => {
|
|
1079
1079
|
try {
|
|
1080
1080
|
const { redirectUrlWixPages } = await auth.elevate(es_exports.getOAuthApp)(
|
|
1081
1081
|
WIX_CLIENT_ID
|
|
@@ -1083,7 +1083,9 @@ var GET = async ({ url }) => {
|
|
|
1083
1083
|
if (redirectUrlWixPages == null) {
|
|
1084
1084
|
throw new Error(`Invalid Redirect URL: ${redirectUrlWixPages}`);
|
|
1085
1085
|
}
|
|
1086
|
-
const
|
|
1086
|
+
const paylinkId = params.id;
|
|
1087
|
+
const baseUrl = redirectUrlWixPages.endsWith("/") ? redirectUrlWixPages : `${redirectUrlWixPages}/`;
|
|
1088
|
+
const paylinkUrl = new URL(`_paylink/${paylinkId}`, baseUrl);
|
|
1087
1089
|
return new Response(null, {
|
|
1088
1090
|
headers: { Location: paylinkUrl.toString() },
|
|
1089
1091
|
status: 302
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/astro",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
4
4
|
"devDependencies": {
|
|
5
5
|
"@wix/auth-management": "^1.0.70",
|
|
6
6
|
"@wix/dashboard": "^1.3.35",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
".": "./build/index.js",
|
|
26
26
|
"./context/setup": "./build-browser-runtime/setup.js",
|
|
27
27
|
"./context/setup-webhook": "./build-runtime/context/setupWebhook.js",
|
|
28
|
-
"./context/setup-service-plugin": "./build-runtime/context/setupServicePlugin.js"
|
|
28
|
+
"./context/setup-service-plugin": "./build-runtime/context/setupServicePlugin.js",
|
|
29
|
+
"./package.json": "./package.json"
|
|
29
30
|
},
|
|
30
31
|
"peerDependencies": {
|
|
31
32
|
"@wix/dashboard": "^1.3.35",
|
|
@@ -50,5 +51,5 @@
|
|
|
50
51
|
"artifactId": "wix-astro"
|
|
51
52
|
}
|
|
52
53
|
},
|
|
53
|
-
"falconPackageHash": "
|
|
54
|
+
"falconPackageHash": "5dcf23446b8dffbca01615c5bdb7455061cb4a01c86e30fce676dfd9"
|
|
54
55
|
}
|
|
@@ -3,7 +3,7 @@ import { oAuthApps } from '@wix/auth-management';
|
|
|
3
3
|
import { auth } from '@wix/essentials';
|
|
4
4
|
import { WIX_CLIENT_ID } from 'astro:env/client';
|
|
5
5
|
|
|
6
|
-
export const GET: APIRoute = async ({
|
|
6
|
+
export const GET: APIRoute = async ({ params }) => {
|
|
7
7
|
try {
|
|
8
8
|
const { redirectUrlWixPages } = await auth.elevate(oAuthApps.getOAuthApp)(
|
|
9
9
|
WIX_CLIENT_ID
|
|
@@ -13,7 +13,13 @@ export const GET: APIRoute = async ({ url }) => {
|
|
|
13
13
|
throw new Error(`Invalid Redirect URL: ${redirectUrlWixPages}`);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const paylinkId = params.id;
|
|
17
|
+
|
|
18
|
+
const baseUrl = redirectUrlWixPages.endsWith('/')
|
|
19
|
+
? redirectUrlWixPages
|
|
20
|
+
: `${redirectUrlWixPages}/`;
|
|
21
|
+
|
|
22
|
+
const paylinkUrl = new URL(`_paylink/${paylinkId}`, baseUrl);
|
|
17
23
|
|
|
18
24
|
return new Response(null, {
|
|
19
25
|
headers: { Location: paylinkUrl.toString() },
|