{% 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: ``connection`` describes the kind of account, ``settings`` fill its fields, ``suffix`` keeps ids apart, ``error`` shows under the password why the last try was refused. #} {% macro connect_form(email, settings, connection, suffix="", password_label=None, 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, connections[candidate.provider.value], suffix=loop.index, 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 }} was found. Enter your provider's servers.
{% endif %} {{ connect_form(discovery.email, {}, connection, suffix="hand-" ~ connection.kind, folded=False, primary=nothing_found and loop.first, hint="Tried against the server first, then stored encrypted. Never shown again.") }}| {{ report.source.value }} | {{ report.outcome.value }} | {{ report.message | or_missing }} |