()
| 1530 | |
| 1531 | def _clear_device_token_cookie(resp): |
| 1532 | resp.delete_cookie(DEVICE_TOKEN_COOKIE) |
| 1533 | # Do not delete fp cookie so device approval flow can work. |
| 1534 | |
| 1535 | def _trusted_device_lookup(fp: str, token: str) -> Optional[str]: |
| 1536 | """Return username if token matches a trusted device and is approved.""" |
| 1537 | if not fp or not token: |
| 1538 | return None |
| 1539 | th = _sha256_hex(token) |
| 1540 | if not th: |
| 1541 | return None |
| 1542 | conn = db_connect() |
| 1543 | row = conn.execute( |
nothing calls this directly
no test coverage detected