Fix: preserve API key on login (don't overwrite with placeholder)

This commit is contained in:
Warren
2026-05-20 15:46:28 +08:00
parent e60ba995b9
commit e5985e625d

View File

@@ -217,8 +217,7 @@ const handleLogin = async () => {
if (data.success) {
localStorage.setItem('momentry_user', JSON.stringify(data.user))
localStorage.setItem('momentry_api_key', data.api_key)
const config = getCurrentConfig()
saveConfig({ ...config, api_key: data.api_key })
// Keep the existing api_key from config/env (login response key may be a placeholder)
const redirect = (route.query.redirect as string) || '/home'
router.push(redirect)
} else {