fix(auth): make things work
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user