14 lines
341 B
TypeScript
14 lines
341 B
TypeScript
// /src/app/lib/signOutWithStatus.ts
|
|
'use client'
|
|
|
|
import { signOut } from 'next-auth/react'
|
|
|
|
export async function signOutWithStatus() {
|
|
try {
|
|
await fetch('/api/user/offline', { method: 'POST' })
|
|
} catch (err) {
|
|
console.error('[signOutWithStatus] konnte OFFLINE nicht setzen:', err)
|
|
}
|
|
return signOut({ callbackUrl: '/' })
|
|
}
|