pedromcr
pedromcr
TTCTheo's Typesafe Cult
Created by pedromcr on 3/12/2024 in #questions
Adding a staging environment using the T3 stack (deployed on Vercel)
Hi, I'm creating a SaaS product and I used the T3 stack to bootstrap it. I already have a dev and prod environment (deployed to DigitalOcean, not Vercel), and I'd like to add a staging environment as well, but deployed to Vercel. It seems Next.js doesn't want people to use any env vars except for development, test and production (https://nextjs.org/docs/app/building-your-application/configuring/environment-variables#environment-variable-load-order). I also found this discussion https://github.com/vercel/next.js/discussions/12077 but there doesn't seem to be a good official solution. Why isn't this trivially addressed in the docs when so many businesses relying on Next.js surely use a staging environment to scale their products? What's the best way to setup such an environment? One that simulates production that I can use for closely replicating prod (probably with some mock data) when adding new features? Thanks in advance
1 replies
TTCTheo's Typesafe Cult
Created by pedromcr on 3/21/2023 in #questions
How to avoid page load when verifying email with NextAuth
Hi, I'm new to the T3 stack and web dev as a whole, and as the title implies, I'm trying to stay on the same page without reloading it when calling NextAuth's signIn() method with the Email provider. In a settings page, the user can change their e-mail but must verify it by pressing a button. The button handler is calling NextAuth's signIn() as shown below
async function handleVerification(providerId: string) {
await signIn(providerId, { email: user?.email, redirect: false });
setVerifyState("Sent");
}
async function handleVerification(providerId: string) {
await signIn(providerId, { email: user?.email, redirect: false });
setVerifyState("Sent");
}
All I want is for the user to be sent the e-mail that the default Email sign in sends when they click the button, and I thought redirect:false would do the job, but it doesn't. How should I proceed? Thanks in advance
14 replies