Compare commits

..

No commits in common. "d85f08fb7a4b8b0e1ae184da28986c8c99489da0" and "558adbb84fa203242bbe9c19bd29f82d150a2019" have entirely different histories.

3 changed files with 7 additions and 3 deletions

View File

@ -48,7 +48,7 @@ export default async function Login({
)
const session = (await supabase.auth.getSession()).data.session
console.log("[login page]Login session:", session)
console.log("[login page]Login session==>:", session)
if (session) {
const { data: homeWorkspace, error } = await supabase
@ -93,9 +93,8 @@ export default async function Login({
.single()
if (!homeWorkspace) {
const fallbackMessage = t("login.unexpectedError")
throw new Error(
homeWorkspaceError?.message || fallbackMessage
homeWorkspaceError?.message || t("login.unexpectedError")
)
}

View File

@ -26,6 +26,8 @@ export function LanguageSwitcher() {
const isLocaleInPath = i18nConfig.locales.includes(currentLocale as any)
console.log('[LanguageSwitcher]=>i18nConfig.locales default=', currentLocale)
}
else{
console.log('[LanguageSwitcher] language switcher cannt running in server.')
@ -39,9 +41,11 @@ export function LanguageSwitcher() {
document.cookie = `preferred-language=${newLocale}; path=/; max-age=31536000`
// 同时更新 localStorage
console.log('[LanguageSwitcher] Write to localStorage newLocale value:', newLocale)
localStorage.setItem('preferred-language', newLocale)
// 验证 cookie 是否成功写入
console.log('[LanguageSwitcher] Read back to check if cookie value saved?', document.cookie)
const cookieValue = document.cookie
// 更新 i18n 的语言

View File

@ -18,6 +18,7 @@ export default function HomeRedirector() {
const currentPath = window.location.pathname
console.log('[HomeRedirector] localStorage preferred:', preferred)
console.log('[HomeRedirector] currentPath:', currentPath)
if (!preferred || !isValidLocale(preferred)) {
console.log('[HomeRedirector] No valid preferred language found.')