Update NavigationBar.tsx

This commit is contained in:
Damien Ostler 2024-05-28 00:10:45 -04:00
parent 2c036794ff
commit b99f3fa256

View File

@ -3,6 +3,7 @@
import { createClient } from "@/utils/supabase/client"; import { createClient } from "@/utils/supabase/client";
import Link from "next/link"; import Link from "next/link";
import crypto from 'crypto'; import crypto from 'crypto';
import { useRouter } from 'next/router';
export default async function AuthButton() { export default async function AuthButton() {
@ -22,9 +23,9 @@ export default async function AuthButton() {
// ... // ...
const url = window.location.href;
const urlObj = new URL(url); const router = useRouter();
const currentPage = urlObj.pathname; const currentPage = router.pathname;
if(user){ if(user){
let email = user.email; let email = user.email;
if(email != null){ if(email != null){