diff --git a/apps/web/pages/auth/verify.tsx b/apps/web/pages/auth/verify.tsx
index 48c52773d8..12d2c4c4f5 100644
--- a/apps/web/pages/auth/verify.tsx
+++ b/apps/web/pages/auth/verify.tsx
@@ -60,10 +60,16 @@ export default function Verify() {
const routerQuery = useRouterQuery();
const { t, sessionId, stripeCustomerId } = querySchema.parse(routerQuery);
const [secondsLeft, setSecondsLeft] = useState(30);
- const { data } = trpc.viewer.public.stripeCheckoutSession.useQuery({
- stripeCustomerId,
- checkoutSessionId: sessionId,
- });
+ const { data } = trpc.viewer.public.stripeCheckoutSession.useQuery(
+ {
+ stripeCustomerId,
+ checkoutSessionId: sessionId,
+ },
+ {
+ enabled: !!stripeCustomerId || !!sessionId,
+ staleTime: Infinity,
+ }
+ );
useSendFirstVerificationLogin({ email: data?.customer?.email, username: data?.customer?.username });
// @note: check for t=timestamp and apply disabled state and secondsLeft accordingly
// to avoid refresh to skip waiting 30 seconds to re-send email
@@ -123,12 +129,12 @@ export default function Verify() {
{hasPaymentFailed ? (
Your account has been created, but your premium has not been reserved.
)} -+
We have sent an email to {customer?.email} with a link to activate your account.{" "} {hasPaymentFailed && "Once you activate your account you will be able to try purchase your premium username again or select a different one."} @@ -158,7 +164,7 @@ export default function Verify() { e.preventDefault(); setSecondsLeft(30); // Update query params with t:timestamp, shallow: true doesn't re-render the page - const _searchParams = new URLSearchParams(searchParams); + const _searchParams = new URLSearchParams(searchParams.toString()); _searchParams.set("t", `${Date.now()}`); router.replace(`${pathname}?${_searchParams.toString()}`); return await sendVerificationLogin(customer.email, customer.username);