From 3b5812c67b730dce5ecc31be5a992f39fa86eaee Mon Sep 17 00:00:00 2001 From: Saatvik Arya Date: Thu, 25 Jul 2024 16:25:47 -0700 Subject: [PATCH] fix --- apps/web/app/(auth)/signin/page.tsx | 9 +-------- apps/web/app/(dash)/header/signOutButton.tsx | 4 +++- apps/web/app/(landing)/page.tsx | 8 -------- apps/web/middleware.ts | 15 +++++++++++---- apps/web/routes.ts | 1 + 5 files changed, 16 insertions(+), 21 deletions(-) diff --git a/apps/web/app/(auth)/signin/page.tsx b/apps/web/app/(auth)/signin/page.tsx index e2524a5b..c7cceec5 100644 --- a/apps/web/app/(auth)/signin/page.tsx +++ b/apps/web/app/(auth)/signin/page.tsx @@ -1,21 +1,14 @@ import Image from "next/image"; import Link from "next/link"; import Logo from "@/public/logo.svg"; -import { auth, signIn } from "@/server/auth"; +import { signIn } from "@/server/auth"; import { Google } from "@repo/ui/components/icons"; import gradientStyle from "./_components/TextGradient/gradient.module.css"; import { cn } from "@repo/ui/lib/utils"; -import { redirect } from "next/navigation"; export const runtime = "edge"; async function Signin() { - const user = await auth(); - - if (user) { - redirect("/home"); - } - return (
diff --git a/apps/web/app/(dash)/header/signOutButton.tsx b/apps/web/app/(dash)/header/signOutButton.tsx index 3ef5fa2a..7f6ba818 100644 --- a/apps/web/app/(dash)/header/signOutButton.tsx +++ b/apps/web/app/(dash)/header/signOutButton.tsx @@ -6,7 +6,9 @@ export default function SignOutButton() {
{ "use server" - await signOut() + await signOut({ + redirectTo: "/", + }); }} >