mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-04 18:00:38 +08:00
Update auth.ts
This commit is contained in:
parent
968a2dc753
commit
e99c2568f4
@ -88,15 +88,10 @@ export async function supaAuthenticateUser(
|
||||
// console.log('Key and Price ID:', data);
|
||||
}
|
||||
|
||||
if(error) {
|
||||
return {
|
||||
success: false,
|
||||
error: "Unauthorized: Invalid token or server error.",
|
||||
status: 500,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
if (!data || data.length === 0) {
|
||||
if (error || !data || data.length === 0) {
|
||||
Logger.warn(`Error fetching api key: ${error.message} or data is empty`);
|
||||
return {
|
||||
success: false,
|
||||
error: "Unauthorized: Invalid token",
|
||||
@ -186,16 +181,10 @@ export async function supaAuthenticateUser(
|
||||
.select("*")
|
||||
.eq("key", normalizedApi);
|
||||
|
||||
if (error) {
|
||||
Logger.warn(`Error fetching api key: ${error.message}`);
|
||||
return {
|
||||
success: false,
|
||||
error: "Unauthorized: Invalid token or server error.",
|
||||
status: 500,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
if (!data || data.length === 0) {
|
||||
if (error || !data || data.length === 0) {
|
||||
Logger.warn(`Error fetching api key: ${error.message} or data is empty`);
|
||||
return {
|
||||
success: false,
|
||||
error: "Unauthorized: Invalid token",
|
||||
|
Loading…
x
Reference in New Issue
Block a user