{% extends "base.html" %} {% from "components/ui.html" import breadcrumb, csrf_field with context %} {% from "components/connection.html" import connection_fields %} {% block title %}Connect an account ยท {{ APP_NAME }}{% endblock %} {% block heading %}Connect an account{% endblock %} {% block subheading %}{{ breadcrumb([("Accounts", "/ui/accounts"), ("Connect an account", None)]) }}{% endblock %} {% block content %} {# Connect with a password: ``settings`` fill the server fields, a ``provider`` names the candidate's, ``suffix`` keeps ids apart, ``error`` shows under the password why the last try was refused. #} {% macro connect_form(email, settings, suffix="", provider=None, password_label="Password", hint=None, folded=True, primary=True, display_name="", error=None) %} {% set ids = "-" ~ suffix if suffix else "" %}
{% endmacro %} {# Two ways: in this browser, sent back to this service, or with a code entered at the provider on any device. The first only where the provider can send the browser back here (``in_browser``), the second only where it offers codes (``with_code``). #} {% macro sign_in_form(provider, hint="") %} {% if provider in in_browser %} {% endif %} {% if provider in with_code %} {% endif %} {% endmacro %} {% macro ways_hint(provider) %}{% if provider in in_browser and provider in with_code %}In the browser, the provider sends you back to this service. Or sign in with a code on any device.{% elif provider in in_browser %}In the browser, the provider sends you back to this service.{% else %}{{ provider | signs_in_at }} sends a browser back to this service only at localhost, so you sign in with a code on any device.{% endif %}{% endmacro %}Asks public sources how the address's provider is reached. No password leaves this service.
{{ hint.text }}{% if hint.url %} More{% endif %}
{% endfor %} {{ connect_form(discovery.email, candidate.settings, suffix=loop.index, provider=candidate.provider.value, password_label={"app_password": "App password", "api_token": "API token"}.get(candidate.credential.value, "Password"), hint="Tried against the provider first, then stored encrypted. Never shown again.") }}No way to connect {{ discovery.email }} over JMAP, IMAP or POP3 was found. Enter your provider's servers.
{% endif %} {{ connect_form(discovery.email, {}, suffix="hand", folded=False, primary=not usable and not sign_ins) }}| {{ report.source.value }} | {{ report.outcome.value }} | {{ report.message | or_missing }} |