's'
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
type PayjsVipResult = {
|
||||
vip: boolean;
|
||||
email?: string;
|
||||
linkedUserId?: string;
|
||||
};
|
||||
|
||||
const inflightUserChecks = new Map<string, Promise<PayjsVipResult | null>>();
|
||||
@@ -108,6 +109,10 @@ async function checkVipFromPayjsapi(
|
||||
typeof data?.email === "string" && data.email.trim()
|
||||
? data.email.trim().toLowerCase()
|
||||
: undefined,
|
||||
linkedUserId:
|
||||
typeof data?.linked_user_id === "string" && data.linked_user_id.trim()
|
||||
? data.linked_user_id.trim()
|
||||
: undefined,
|
||||
};
|
||||
console.log(
|
||||
"[check-by-user] payjsapi response user_id=%s vip=%s email=%s",
|
||||
@@ -214,6 +219,7 @@ export async function POST(request: NextRequest) {
|
||||
if (payjsResult?.vip) {
|
||||
vip = true;
|
||||
email = payjsResult.email ?? null;
|
||||
linkedUserId = payjsResult.linkedUserId;
|
||||
vipSource = "payjsapi";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user