import { signOutAction } from "@/app/actions"; import { hasEnvVars } from "@/utils/supabase/check-env-vars"; import Link from "next/link"; import { Badge } from "./ui/badge"; import { Button } from "./ui/button"; import { createClient } from "@/utils/supabase/server"; export default async function AuthButton() { const supabase = await createClient(); const { data: { user }, } = await supabase.auth.getUser(); if (!hasEnvVars) { return ( <>
Please update .env.local file with anon key and url
); } return user ? (
Hey, {user.email}!
) : (
); }