This commit is contained in:
hailin 2025-05-20 23:03:35 +08:00
parent c90b7eba69
commit 4b9f4489ca
1 changed files with 10 additions and 6 deletions

View File

@ -120,14 +120,18 @@ export default async function Login({
// Since we used `.limit(1)`, we can safely use `.single()` now
const workspace = homeWorkspace[0]; // Use the first (and only) row
if (!homeWorkspace) {
//const fallbackMessage = String(t("login.unexpectedError"))
throw new Error(
homeWorkspaceError?.message || "An unexpected error occurred"
// homeWorkspaceError?.message || t("login.unexpectedError")
)
if (!homeWorkspace || homeWorkspace.length === 0) {
throw new Error(homeWorkspaceError?.message || "No home workspace found for this user.");
}
// if (!homeWorkspace) {
// //const fallbackMessage = String(t("login.unexpectedError"))
// throw new Error(
// homeWorkspaceError?.message || "An unexpected error occurred"
// // homeWorkspaceError?.message || t("login.unexpectedError")
// )
// }
return redirect(`/${localeString}/${workspace.id}/chat`)
//return redirect(`/${localeString}/${homeWorkspace.id}/chat`)
}