Fix edge compat
This commit is contained in:
parent
c332a1b6f1
commit
0996de27e6
2 changed files with 7 additions and 4 deletions
|
|
@ -1,11 +1,13 @@
|
||||||
"use client";
|
"use client";
|
||||||
import { signIn } from "@auth/nextjs/client";
|
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
export function Login() {
|
export function Login() {
|
||||||
|
const router = useRouter();
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
className="inline-flex w-full items-center justify-center rounded border border-zinc-800 bg-white h-8 px-4 -my-1.5 text-sm leading-6 tracking-tight text-zinc-900 transition-colors ease-in-out hover:bg-zinc-100 disabled:cursor-not-allowed disabled:opacity-50"
|
className="inline-flex w-full items-center justify-center rounded border border-zinc-800 bg-white h-8 px-4 -my-1.5 text-sm leading-6 tracking-tight text-zinc-900 transition-colors ease-in-out hover:bg-zinc-100 disabled:cursor-not-allowed disabled:opacity-50"
|
||||||
onClick={() => signIn("github")}
|
onClick={() => router.push("/api/auth/signin")}
|
||||||
>
|
>
|
||||||
<span className="font-medium">Login</span>
|
<span className="font-medium">Login</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,16 @@
|
||||||
import { ThemeToggle } from "@/components/theme-toggle";
|
import { ThemeToggle } from "@/components/theme-toggle";
|
||||||
import { type Session } from "@auth/nextjs/types";
|
import { type Session } from "@auth/nextjs/types";
|
||||||
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
|
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
|
||||||
import { signOut } from "@auth/nextjs/client";
|
|
||||||
|
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
export interface UserMenuProps {
|
export interface UserMenuProps {
|
||||||
session: Session;
|
session: Session;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function UserMenu({ session }: UserMenuProps) {
|
export function UserMenu({ session }: UserMenuProps) {
|
||||||
|
const router = useRouter();
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<DropdownMenu.Root>
|
<DropdownMenu.Root>
|
||||||
|
|
@ -83,7 +84,7 @@ export function UserMenu({ session }: UserMenuProps) {
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
<DropdownMenu.Item
|
<DropdownMenu.Item
|
||||||
className="py-2 px-3 hover:bg-zinc-200 dark:hover:bg-zinc-800 transition-colors duration-200 cursor-pointer text-xs focus:outline-none"
|
className="py-2 px-3 hover:bg-zinc-200 dark:hover:bg-zinc-800 transition-colors duration-200 cursor-pointer text-xs focus:outline-none"
|
||||||
onClick={() => signOut()}
|
onClick={() => router.push("/api/auth/signout")}
|
||||||
>
|
>
|
||||||
Log Out
|
Log Out
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue