Update auth.ts

This commit is contained in:
Nicolas 2024-08-30 11:10:48 -03:00 committed by GitHub
parent 636e39d366
commit 52ac132328
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -104,7 +104,7 @@ export async function supaAuthenticateUser(
status?: number;
plan?: PlanType;
}> {
console.log(req.headers);
const authHeader = req.headers.authorization ?? (req.headers["sec-websocket-protocol"] ? `Bearer ${req.headers["sec-websocket-protocol"]}` : null);
if (!authHeader) {
return { success: false, error: "Unauthorized", status: 401 };