Fix: preserve API key on login (don't overwrite with placeholder)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user