Compare commits

...

4 Commits

Author SHA1 Message Date
2796d13734
Revert "trpc changes"
This reverts commit 83c1618a4435978a1f73e2266f8d488c35a61065.
2025-04-14 09:41:03 +02:00
70eccbe29b
Revert "fix"
This reverts commit f8c26d09db7d7333418931013116715a81943c3f.
2025-04-14 09:40:57 +02:00
4b77152bb0
Revert "modified: src/env.js"
This reverts commit 571a64d1d5b6c3982466bc660e3a6368513b6536.
2025-04-14 09:40:53 +02:00
49483f9109
Revert "modified: src/app/page.tsx"
This reverts commit 6522a256b9700628d735a5676fe949465c666359.
2025-04-14 09:40:39 +02:00
5 changed files with 9 additions and 13 deletions

View File

@ -4,7 +4,6 @@ import { HydrateClient } from "~/trpc/server";
import FileGrid from "~/app/_components/FileGrid"; import FileGrid from "~/app/_components/FileGrid";
import UploadForm from "~/app/_components/UploadForm"; import UploadForm from "~/app/_components/UploadForm";
import { Toaster } from "react-hot-toast"; import { Toaster } from "react-hot-toast";
import { signIn, signOut } from "next-auth/react";
export default async function Home() { export default async function Home() {
const session = await auth(); const session = await auth();
@ -43,12 +42,14 @@ export default async function Home() {
)} )}
{!session?.user && ( {!session?.user && (
<div className="flex flex-col items-center gap-2"> <div className="flex flex-col items-center gap-2">
<button <div className="flex flex-col items-center justify-center gap-4">
onClick={() => (session ? signOut() : signIn())} <Link
className="rounded-full bg-white/10 px-10 py-3 font-semibold no-underline transition hover:bg-white/20" href={session ? "/api/auth/signout" : "/api/auth/signin"}
> className="rounded-full bg-white/10 px-10 py-3 font-semibold no-underline transition hover:bg-white/20"
{session ? "Sign out" : "Sign in"} >
</button> {session ? "Sign out" : "Sign in"}
</Link>
</div>
</div> </div>
)} )}
</div> </div>

View File

@ -19,7 +19,6 @@ export const env = createEnv({
NODE_ENV: z NODE_ENV: z
.enum(["development", "test", "production"]) .enum(["development", "test", "production"])
.default("development"), .default("development"),
URL: z.string().url().optional(),
}, },
/** /**
@ -41,7 +40,6 @@ export const env = createEnv({
AUTH_DISCORD_SECRET: process.env.AUTH_DISCORD_SECRET, AUTH_DISCORD_SECRET: process.env.AUTH_DISCORD_SECRET,
DATABASE_URL: process.env.DATABASE_URL, DATABASE_URL: process.env.DATABASE_URL,
NODE_ENV: process.env.NODE_ENV, NODE_ENV: process.env.NODE_ENV,
URL: process.env.NEXT_PUBLIC_URL,
}, },
/** /**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially

View File

@ -74,7 +74,5 @@ export function TRPCReactProvider(props: { children: React.ReactNode }) {
function getBaseUrl() { function getBaseUrl() {
if (typeof window !== "undefined") return window.location.origin; if (typeof window !== "undefined") return window.location.origin;
if (process.env.VERCEL_URL) return `https://${process.env.VERCEL_URL}`; if (process.env.VERCEL_URL) return `https://${process.env.VERCEL_URL}`;
if (process.env.REVALIDATE_URL) return `https://${process.env.REVALIDATE_URL}`; return `http://localhost:${process.env.PORT ?? 3000}`;
if (process.env.URL) return process.env.URL;
return `http://:${process.env.PORT ?? 3000}`;
} }

View File

@ -8,7 +8,6 @@ import { createCaller, type AppRouter } from "~/server/api/root";
import { createTRPCContext } from "~/server/api/trpc"; import { createTRPCContext } from "~/server/api/trpc";
import { createQueryClient } from "./query-client"; import { createQueryClient } from "./query-client";
/** /**
* This wraps the `createTRPCContext` helper and provides the required context for the tRPC API when * This wraps the `createTRPCContext` helper and provides the required context for the tRPC API when
* handling a tRPC call from a React Server Component. * handling a tRPC call from a React Server Component.