"use client"; import { createClient } from "@/utils/supabase/client"; import Link from "next/link"; import crypto from 'crypto'; export default async function AuthButton() { const supabase = createClient(); const { data: { user }, } = await supabase.auth.getUser(); const signOut = async () => { const supabase = createClient(); await supabase.auth.signOut(); window.location.href = "/gallery"; }; // ... console.log(heads) const url = heads.get('next-url') if(url == null) throw new Error('No URL found') const urlObj = new URL(url); const currentPage = urlObj.pathname; if(user){ let email = user.email; if(email != null){ const emailHash = crypto.createHash('md5').update(email.trim().toLowerCase()).digest('hex'); const gravatarUrl = `https://www.gravatar.com/avatar/${emailHash}`; return(