-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
808f7b8
commit 5a001df
Showing
4 changed files
with
64 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { cookies } from "next/headers"; | ||
import { redirect } from "next/navigation"; | ||
import { createServerClient, type CookieOptions } from "@supabase/ssr"; | ||
|
||
export async function GET() { | ||
const cookieStore = cookies(); | ||
|
||
const supabase = createServerClient( | ||
process.env.NEXT_PUBLIC_SUPABASE_URL!, | ||
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, | ||
{ | ||
cookies: { | ||
get(name: string) { | ||
return cookieStore.get(name)?.value; | ||
}, | ||
set(name: string, value: string, options: CookieOptions) { | ||
cookieStore.set({ name, value, ...options }); | ||
}, | ||
remove(name: string, options: CookieOptions) { | ||
cookieStore.delete({ name, ...options }); | ||
}, | ||
}, | ||
}, | ||
); | ||
|
||
const { | ||
data: { session }, | ||
} = await supabase.auth.getSession(); | ||
|
||
if (session) { | ||
await supabase.auth.signOut(); | ||
} | ||
|
||
redirect("/"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,21 +4,14 @@ import Link from "next/link"; | |
import Image from "next/image"; | ||
import { Disclosure, Menu, Transition } from "@headlessui/react"; | ||
import { Bars3Icon, BellIcon, XMarkIcon } from "@heroicons/react/24/outline"; | ||
import { createBrowserClient } from "@supabase/ssr"; | ||
import clsx from "clsx"; | ||
import beerTap from "@/public/beer-tap.png"; | ||
|
||
// const user = { | ||
// name: "Tom Cook", | ||
// email: "[email protected]", | ||
// imageUrl: | ||
// "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80", | ||
// }; | ||
const navigation = [{ name: "Dashboard", href: "/query", current: true }]; | ||
const userNavigation = [ | ||
{ name: "Your Profile", href: "#" }, | ||
{ name: "Settings", href: "#" }, | ||
{ name: "Sign out", href: "#" }, | ||
{ name: "Sign out", href: "/auth/signout" }, | ||
]; | ||
|
||
export default function Header({ user }: { user: any }) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters