Postgres
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { auth } from '@/lib/auth'
|
||||
import { auth, getSanitizedHeaders } from '@/lib/auth'
|
||||
import { prisma } from '@innungsapp/shared'
|
||||
import { headers } from 'next/headers'
|
||||
import Link from 'next/link'
|
||||
@@ -7,7 +7,7 @@ import { redirect } from 'next/navigation'
|
||||
export default async function GlobalDashboardRedirect() {
|
||||
const headerList = await headers()
|
||||
const host = headerList.get('host') || ''
|
||||
const session = await auth.api.getSession({ headers: headerList })
|
||||
const session = await auth.api.getSession({ headers: await getSanitizedHeaders(headerList) })
|
||||
|
||||
if (!session?.user) {
|
||||
redirect('/login')
|
||||
@@ -93,9 +93,8 @@ export default async function GlobalDashboardRedirect() {
|
||||
|
||||
<form action={async () => {
|
||||
'use server'
|
||||
const { auth } = await import('@/lib/auth')
|
||||
const { headers } = await import('next/headers')
|
||||
await auth.api.signOut({ headers: await headers() })
|
||||
const { auth, getSanitizedHeaders } = await import('@/lib/auth')
|
||||
await auth.api.signOut({ headers: await getSanitizedHeaders() })
|
||||
redirect('/login')
|
||||
}}>
|
||||
<button type="submit" className="text-sm font-medium text-brand-600 hover:text-brand-700">
|
||||
|
||||
Reference in New Issue
Block a user