用设备 Cookie 和授权表记住本机已验证账号,登录页按确认样图做成门户,不再把密码写进浏览器。 Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: multica-agent <github@multica.ai>
26 lines
908 B
Python
26 lines
908 B
Python
from __future__ import annotations
|
|
|
|
|
|
class AccountRoutesMixin:
|
|
def _handle_accounts_public_get(self, parsed) -> bool:
|
|
if parsed.path == "/api/auth/me":
|
|
self.auth_me()
|
|
return True
|
|
if parsed.path == "/api/auth/accounts":
|
|
self.auth_accounts()
|
|
return True
|
|
return False
|
|
|
|
def _handle_accounts_get(self, parsed) -> bool:
|
|
if parsed.path == "/api/account/status":
|
|
self.send_json({"ok": True, **self.application_service.status()})
|
|
return True
|
|
return False
|
|
|
|
def _handle_accounts_delete(self, parsed) -> bool:
|
|
if parsed.path == "/api/account/birth-profile":
|
|
deleted = self.application_service.database.delete_user_birth_profile(self.application_service.current_user_id)
|
|
self.send_json({"ok": True, "deleted": deleted})
|
|
return True
|
|
return False
|