current_user. Internal helper function. This docstring was added automatically to improve maintainability. Returns: Varies.
()
| 1720 | # cookie is set in after_request if needed |
| 1721 | pass |
| 1722 | if is_logged_in(): |
| 1723 | return None |
| 1724 | fp = (request.cookies.get(DEVICE_FP_COOKIE) or "").strip() |
| 1725 | tok = (request.cookies.get(DEVICE_TOKEN_COOKIE) or "").strip() |
| 1726 | if not fp or not tok: |
| 1727 | return None |
| 1728 | u = _trusted_device_lookup(fp, tok) |
| 1729 | if not u: |
| 1730 | return None |
| 1731 | # Do not auto-login when 2FA is enabled. |
| 1732 | if user_2fa_enabled(u): |
| 1733 | return None |
| 1734 | # Scope capacity check (match normal login) |
| 1735 | try: |
no outgoing calls
no test coverage detected