fix(auth): make things work

This commit is contained in:
Michael Zetterberg
2024-05-20 09:05:49 +02:00
parent c4912bbb94
commit 476e9f7582
19 changed files with 122 additions and 82 deletions

View File

@@ -44,11 +44,7 @@ export const middleware = auth(async (request) => {
const isLoggedIn = !!request.auth
const hasError = request.auth?.error
if (hasError) {
throw internalServerError(request.auth?.error)
}
if (isLoggedIn) {
if (isLoggedIn && !hasError) {
const headers = new Headers(request.headers)
headers.set("x-continue", "1")
return NextResponse.next({