mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 06:57:12 +01:00
migrate auth from next-auth to better-auth with magic link support
Replace next-auth with better-auth, adding magic link email login as the primary auth method and GitHub OAuth as an optional social provider. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { useSession, signOut } from 'next-auth/react'
|
||||
import { useSession, signOut } from '../lib/auth-client'
|
||||
import Link from 'next/link'
|
||||
|
||||
export default function User() {
|
||||
const { data, status } = useSession()
|
||||
const { data: session, isPending } = useSession()
|
||||
|
||||
if (status === 'loading' || !data?.user?.email) {
|
||||
if (isPending || !session?.user?.email) {
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export default function User() {
|
||||
Admin
|
||||
</Link>
|
||||
<div className="font-extrabold bg-red-400 px-2 py-1 mr-3 rounded-xs">
|
||||
{data.user.email}
|
||||
{session.user.email}
|
||||
</div>
|
||||
<button onClick={() => signOut()} className="btn btn-blue">
|
||||
Logout
|
||||
|
||||
Reference in New Issue
Block a user