fix: sync user name from external auth API and fix audit log schema

- Auth router: Extract user name from nested data.userInfo.name structure
- Auth router: Sync user name on every login (not just on user creation)
- Audit schema: Change changes field type to Optional[Any] to support
  both list and dict formats (fixes 500 error on audit page)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
beabigegg
2026-01-10 10:12:35 +08:00
parent 55f85d0d3c
commit 96210c7ad4
2 changed files with 12 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ class AuditLogResponse(BaseModel):
resource_id: Optional[str]
user_id: Optional[str]
action: str
changes: Optional[List[dict]]
changes: Optional[Any] # Can be List[dict] or dict depending on event type
request_metadata: Optional[dict]
sensitivity_level: str
checksum: str