Implement next-auth v5

This commit is contained in:
Jared Palmer 2023-06-16 11:49:14 -04:00
parent a9e4956909
commit 187b55aad7
15 changed files with 420 additions and 547 deletions

View file

@ -5,7 +5,7 @@ import * as React from 'react'
import { cn } from '@/lib/utils'
import { Button, type ButtonProps } from '@/components/ui/button'
import { IconGitHub, IconSpinner } from '@/components/ui/icons'
import { useClerk } from '@clerk/nextjs'
import { signIn } from 'next-auth/react'
interface LoginButtonProps extends ButtonProps {
text?: string
@ -17,14 +17,13 @@ export function LoginButton({
...props
}: LoginButtonProps) {
const [isLoading, setIsLoading] = React.useState(false)
const clerk = useClerk()
return (
<Button
variant="outline"
onClick={() => {
setIsLoading(true)
clerk.openSignIn({})
signIn('github')
}}
disabled={isLoading}
className={cn(className)}