Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: ERR_HTTP_HEADERS_SENT error

phamhieub31d8ab88706
diff --git a/studio/lib/api/apiAuthenticate.ts b/studio/lib/api/apiAuthenticate.ts
index b3f195d2983..d7d85dcee84 100644
--- a/studio/lib/api/apiAuthenticate.ts
+++ b/studio/lib/api/apiAuthenticate.ts
@@ -54,7 +54,7 @@ async function fetchUser(req: NextApiRequest, res: NextApiResponse): Promise<any
const token = req.headers.authorization
if (!token) {
- return res.status(401).end('Unauthorized: missing access token')
+ throw new Error('missing access token')
}
let { user: gotrue_user, error: authError } = await getAuthUser(token)
if (authError) {