fix: set magic link redirect from env
This commit is contained in:
@@ -17,6 +17,7 @@ export const env = createEnv({
|
||||
NODE_ENV: z
|
||||
.enum(["development", "test", "production"])
|
||||
.default("development"),
|
||||
WEBSITE_URL: z.string().url(),
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -35,6 +36,7 @@ export const env = createEnv({
|
||||
runtimeEnv: {
|
||||
POSTGRES_URL: process.env.POSTGRES_URL,
|
||||
NODE_ENV: process.env.NODE_ENV,
|
||||
WEBSITE_URL: process.env.WEBSITE_URL,
|
||||
// NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -26,9 +26,11 @@ const MyApp: AppType = ({ Component, pageProps }) => {
|
||||
<style jsx global>{`
|
||||
html {
|
||||
font-family: ${jakarta.style.fontFamily};
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
`}</style>
|
||||
<main className="h-screen overflow-hidden font-sans">
|
||||
<main className="font-sans">
|
||||
<ThemeProvider>
|
||||
<ModalProvider>
|
||||
<BoardProvider>
|
||||
|
||||
@@ -2,6 +2,8 @@ import { z } from "zod";
|
||||
|
||||
import { createTRPCRouter, publicProcedure } from "~/server/api/trpc";
|
||||
|
||||
import { env } from "~/env.mjs";
|
||||
|
||||
export const authRouter = createTRPCRouter({
|
||||
login: publicProcedure
|
||||
.input(z.object({ email: z.string() }))
|
||||
@@ -9,7 +11,7 @@ export const authRouter = createTRPCRouter({
|
||||
const { data } = await ctx.db.auth.signInWithOtp({
|
||||
email: input.email,
|
||||
options: {
|
||||
emailRedirectTo: "/boards",
|
||||
emailRedirectTo: `${env.WEBSITE_URL}`,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user