feat: implement atomic signup trial claims and referral discount logic with Supabase database schema updates

This commit is contained in:
2569718930@qq.com
2026-05-30 16:02:02 +08:00
parent c0b1edaed0
commit 44638760b7
8 changed files with 685 additions and 1 deletions
@@ -26,6 +26,13 @@ export function runTests() {
"auth",
"ResetPasswordClient.tsx",
);
const authCallbackPath = path.join(
projectRoot,
"app",
"auth",
"callback",
"route.ts",
);
const loginClientSource = fs.readFileSync(loginClientPath, "utf8");
@@ -55,4 +62,14 @@ export function runTests() {
resetClientSource.includes("expired"),
"password reset client must detect an expired or invalid recovery session",
);
const authCallbackSource = fs.readFileSync(authCallbackPath, "utf8");
assert(
authCallbackSource.includes("warmSignupTrial") &&
authCallbackSource.includes("exchangeCodeForSession") &&
authCallbackSource.includes("/api/auth/me") &&
authCallbackSource.includes("Authorization") &&
authCallbackSource.includes("Bearer"),
"auth callback must warm /api/auth/me with the exchanged Supabase session so new users receive the signup trial immediately",
);
}