Revert "Unify workspace dropdowns; Update layouts (#458)"

This reverts commit 4bc8448a1d.
This commit is contained in:
gbuomprisco
2026-03-11 14:47:47 +08:00
parent 4bc8448a1d
commit 4912e402a3
530 changed files with 11182 additions and 14382 deletions

View File

@@ -306,16 +306,16 @@ function getAuthErrorMessage(params: { error: string; code?: string }) {
// this error arises when the user tries to sign in with an expired email link
if (params.code) {
if (params.code === 'otp_expired') {
return 'auth.errors.otp_expired';
return 'auth:errors.otp_expired';
}
}
// this error arises when the user is trying to sign in with a different
// browser than the one they used to request the sign in link
if (isVerifierError(params.error)) {
return 'auth.errors.codeVerifierMismatch';
return 'auth:errors.codeVerifierMismatch';
}
// fallback to the default error message
return `auth.authenticationErrorAlertBody`;
return `auth:authenticationErrorAlertBody`;
}

View File

@@ -1,9 +1,9 @@
import 'server-only';
import * as z from 'zod';
import { z } from 'zod';
const message =
'Invalid Supabase Secret Key. Please add the environment variable SUPABASE_SECRET_KEY.';
'Invalid Supabase Secret Key. Please add the environment variable SUPABASE_SECRET_KEY or SUPABASE_SERVICE_ROLE_KEY.';
/**
* @name getSupabaseSecretKey
@@ -13,12 +13,14 @@ const message =
export function getSupabaseSecretKey() {
return z
.string({
error: message,
required_error: message,
})
.min(1, {
message: message,
})
.parse(process.env.SUPABASE_SECRET_KEY);
.parse(
process.env.SUPABASE_SECRET_KEY || process.env.SUPABASE_SERVICE_ROLE_KEY,
);
}
/**

View File

@@ -1,4 +1,4 @@
import * as z from 'zod';
import { z } from 'zod';
/**
* Returns and validates the Supabase client keys from the environment.
@@ -7,14 +7,18 @@ export function getSupabaseClientKeys() {
return z
.object({
url: z.string({
error: `Please provide the variable NEXT_PUBLIC_SUPABASE_URL`,
description: `This is the URL of your hosted Supabase instance. Please provide the variable NEXT_PUBLIC_SUPABASE_URL.`,
required_error: `Please provide the variable NEXT_PUBLIC_SUPABASE_URL`,
}),
publicKey: z.string({
error: `Please provide the variable NEXT_PUBLIC_SUPABASE_PUBLIC_KEY`,
description: `This is the public key provided by Supabase. It is a public key used client-side. Please provide the variable NEXT_PUBLIC_SUPABASE_PUBLIC_KEY.`,
required_error: `Please provide the variable NEXT_PUBLIC_SUPABASE_PUBLIC_KEY`,
}),
})
.parse({
url: process.env.NEXT_PUBLIC_SUPABASE_URL,
publicKey: process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_KEY,
publicKey:
process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_KEY ||
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
});
}

View File

@@ -12,7 +12,7 @@ export function useSignInWithEmailPassword() {
const response = await client.auth.signInWithPassword(credentials);
if (response.error) {
throw response.error;
throw response.error.message;
}
const user = response.data?.user;

View File

@@ -12,7 +12,7 @@ export function useSignInWithProvider() {
const response = await client.auth.signInWithOAuth(credentials);
if (response.error) {
throw response.error;
throw response.error.message;
}
return response.data;

View File

@@ -49,7 +49,7 @@ export function useSignUpWithEmailAndPassword() {
throw new WeakPasswordError(errorObj.reasons ?? []);
}
throw response.error;
throw response.error.message;
}
const user = response.data?.user;