From 82c79c6591ed773816f5aaf07d933fcb410f6954 Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Thu, 9 Nov 2023 20:23:53 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=20Middleware=20crash=20(#1567)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/middleware.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/middleware.ts b/src/middleware.ts index dc088638f..63e2b45d0 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -1,5 +1,3 @@ -import Consola from 'consola'; -import fs from 'fs/promises'; import { NextRequest, NextResponse } from 'next/server'; import { getUrl } from './tools/server/url'; @@ -54,13 +52,6 @@ const shouldRedirectToOnboard = async (): Promise => { } const fileUri = process.env.DATABASE_URL.substring(4); - try { - await fs.access(fileUri, fs.constants.W_OK); - return await cacheAndGetUserCount(); - } catch { - Consola.warn( - `detected that the path ${fileUri} was not readable. Showing onboarding page for setup...` - ); - return true; - } + return await cacheAndGetUserCount(); + // TODO: Show an error page if the database file is read-only };