fix: 并发确认已保存账号,写回前重新读取再合并
This commit is contained in:
@@ -10,7 +10,7 @@ import uuid
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from app.platform.client import NqiError, needs_captcha
|
||||
from app.platform.sessions import available_accounts, remember, resume
|
||||
from app.platform.sessions import available_accounts, remember_account, resume
|
||||
from app.shared.state import state
|
||||
|
||||
logger = logging.getLogger("nqi.auth")
|
||||
@@ -129,7 +129,7 @@ async def login(body: dict) -> dict:
|
||||
pass
|
||||
raise HTTPException(status_code=400, detail=message) from exc
|
||||
challenge.password = ""
|
||||
remember(user, client.export_cookies())
|
||||
await remember_account(user, client.export_cookies())
|
||||
state.flows.pop(session_id, None)
|
||||
if state.client is not None and state.client is not client:
|
||||
await state.client.aclose()
|
||||
|
||||
Reference in New Issue
Block a user