Skip to content

Handle scaned_but_redirect QR login status for IDC redirection #19

Description

@Oaklight

Background

The official SDK handles a scaned_but_redirect status during QR code login polling. After the user scans the QR code, the server may respond with this status and a redirect_host field, indicating the client should continue polling at a different IDC endpoint.

Current behavior

QR login loop handles: confirmed, scaned, expired, and falls through to "keep polling" for unknown statuses. No special handling for scaned_but_redirect.

Investigation needed

  • Does the live API actually return scaned_but_redirect? (May depend on geographic location / IDC routing)
  • What is the format of redirect_host? Full URL or hostname only?
  • How often does this occur in practice?

Phase 1 (logging)

Add DEBUG logging for all poll_qr_status responses to capture any occurrence of this status.

Phase 2 (implementation, after investigation confirms the behavior)

  1. Add scaned_but_redirect branch in QR login loop
  2. Extract redirect_host and switch subsequent polls to that host
  3. Update admin panel's _handle_poll_login similarly

Files

  • src/weilink/client.py
  • src/weilink/admin/handlers.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — nice to haveenhancementNew feature or requestneeds-investigationRequires live API investigationprotocoliLink Bot protocol layer

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions