Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
VideoPress: Validate origin and source before async work in token bridge
Move the origin and source checks above getSubscriberPlanIdIfExists()
so invalid messages are rejected immediately without awaiting async I/O.
  • Loading branch information
obenland committed Mar 5, 2026
commit 52fa4c3d30b79a931319a13fee1ced96ee411911
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ export async function tokenBridgeHandler(
return;
}

const postId = window?.videopressAjax.post_id || 0;
const subscriptionPlanId = await getSubscriberPlanIdIfExists( guid );

if ( ! isAllowedOrigin( event.origin ) ) {
debug( '(%s) Invalid origin', context );
return;
Expand All @@ -107,6 +104,9 @@ export async function tokenBridgeHandler(
return;
}

const postId = window?.videopressAjax.post_id || 0;
const subscriptionPlanId = await getSubscriberPlanIdIfExists( guid );

debug( '(%s) Token request accepted: %o | %o | %o', context, guid, postId, requestId );

/*
Expand Down
Loading