Skip to content

Commit f7fcbee

Browse files
committed
Waitpoint token completion with HTTP is now working
1 parent 71bc1a8 commit f7fcbee

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

apps/webapp/app/routes/api.v1.waitpoints.tokens.$waitpointFriendlyId.callback.$hash.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ export async function action({ request, params }: ActionFunctionArgs) {
4343
environment: {
4444
select: {
4545
apiKey: true,
46+
parentEnvironment: {
47+
select: {
48+
apiKey: true,
49+
},
50+
},
4651
},
4752
},
4853
},
@@ -52,7 +57,13 @@ export async function action({ request, params }: ActionFunctionArgs) {
5257
return json({ error: "Waitpoint not found" }, { status: 404 });
5358
}
5459

55-
if (!verifyHttpCallbackHash(waitpoint.id, hash, waitpoint.environment.apiKey)) {
60+
if (
61+
!verifyHttpCallbackHash(
62+
waitpoint.id,
63+
hash,
64+
waitpoint.environment.parentEnvironment?.apiKey ?? waitpoint.environment.apiKey
65+
)
66+
) {
5667
return json({ error: "Invalid URL, hash doesn't match" }, { status: 401 });
5768
}
5869

0 commit comments

Comments
 (0)