current_user. Internal helper function. This docstring was added automatically to improve maintainability. Returns: Varies.
()
| 1720 | u = _trusted_device_lookup(fp, tok) |
| 1721 | if not u: |
| 1722 | return None |
| 1723 | # Do not auto-login when 2FA is enabled. |
| 1724 | if user_2fa_enabled(u): |
| 1725 | return None |
| 1726 | # Scope capacity check (match normal login) |
| 1727 | try: |
| 1728 | is_admin_u = bool(is_admin(u)) |
| 1729 | sc = current_scope() |
| 1730 | if not scope_capacity_ok(u, is_admin_u, sc): |
| 1731 | return None |
| 1732 | except Exception: |
| 1733 | pass |
| 1734 | |
| 1735 | session["u"] = u |
no outgoing calls
no test coverage detected