Restore strict ensureSupabase
cgen-c113a6366c224046a2ff99b8c1709030
This commit is contained in:
parent
0209d2624f
commit
ea3b0696f4
1 changed files with 0 additions and 8 deletions
|
|
@ -23,16 +23,8 @@ export interface AethexUserProfile extends UserProfile {
|
||||||
const isNonEmptyString = (value: unknown): value is string =>
|
const isNonEmptyString = (value: unknown): value is string =>
|
||||||
typeof value === "string" && value.trim().length > 0;
|
typeof value === "string" && value.trim().length > 0;
|
||||||
|
|
||||||
const isTestEnvironment =
|
|
||||||
typeof process !== "undefined" &&
|
|
||||||
(process.env?.NODE_ENV === "test" || process.env?.VITEST);
|
|
||||||
|
|
||||||
const ensureSupabase = () => {
|
const ensureSupabase = () => {
|
||||||
if (!isSupabaseConfigured) {
|
if (!isSupabaseConfigured) {
|
||||||
if (isTestEnvironment) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Supabase is not configured. Please set VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY.",
|
"Supabase is not configured. Please set VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY.",
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue