// "use server"; import { createClient } from "@/utils/supabase/server"; import Link from "next/link"; import { cookies } from "next/headers"; import { redirect } from "next/navigation"; // import { signOut } from "@/utils/supabase/serversignout"; export default async function AuthButton() { const cookieStore = cookies(); const supabase = createClient(cookieStore); const { data: { user }, } = await supabase.auth.getUser(); const signOut = async () => { "use server"; const cookieStore = cookies(); const supabase = createClient(cookieStore); await supabase.auth.signOut(); return redirect("/login"); }; return user ? (
Hey, {user.email}! {/*
VIP
*/}
) : ( Login ); }