Compare commits

..

1 Commits

Author SHA1 Message Date
Jonas Schäfer
4bd58c1104 Add autocomplete hints to password forms
This allows user agents to do smart things like filling in the current
password only where it makes sense or integrate nicely with a password
manager.

Fixes #94.
2022-01-22 15:34:27 +01:00
4 changed files with 14 additions and 16 deletions

View File

@@ -17,8 +17,7 @@ COPY babel.cfg /opt/snikket-web-portal/babel.cfg
WORKDIR /opt/snikket-web-portal WORKDIR /opt/snikket-web-portal
RUN set -eu; \ RUN pip3 install -r requirements.txt; \
pip3 install -r requirements.txt; \
pip3 install -r build-requirements.txt; \ pip3 install -r build-requirements.txt; \
make; make;
@@ -36,21 +35,20 @@ ENV SNIKKET_WEB_PROSODY_ENDPOINT=http://127.0.0.1:5280/
HEALTHCHECK CMD nc -zv ${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_INTERFACE:-127.0.0.1} ${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT:-5765} HEALTHCHECK CMD nc -zv ${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_INTERFACE:-127.0.0.1} ${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT:-5765}
COPY requirements.txt /opt/snikket-web-portal/requirements.txt
WORKDIR /opt/snikket-web-portal
RUN set -eu; \ RUN set -eu; \
export DEBIAN_FRONTEND=noninteractive ; \ export DEBIAN_FRONTEND=noninteractive ; \
apt-get update ; \ apt-get update ; \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
python3 python3-pip python3-setuptools python3-wheel build-essential libpython3-dev; \ python3 python3-pip python3-setuptools python3-wheel; \
pip3 install -r requirements.txt; \
apt-get remove -y --autoremove build-essential libpython3-dev; \
apt-get clean ; rm -rf /var/lib/apt/lists; \ apt-get clean ; rm -rf /var/lib/apt/lists; \
pip3 install hypercorn; \ pip3 install hypercorn; \
rm -rf /root/.cache; rm -rf /root/.cache;
WORKDIR /opt/snikket-web-portal
COPY requirements.txt /opt/snikket-web-portal/requirements.txt
RUN pip3 install -r requirements.txt; rm -rf /root/.cache;
COPY --from=build /opt/snikket-web-portal/snikket_web/ /opt/snikket-web-portal/snikket_web COPY --from=build /opt/snikket-web-portal/snikket_web/ /opt/snikket-web-portal/snikket_web
COPY babel.cfg /opt/snikket-web-portal/babel.cfg COPY babel.cfg /opt/snikket-web-portal/babel.cfg

View File

@@ -28,12 +28,12 @@
</div> </div>
<div class="f-ebox"> <div class="f-ebox">
{{ form.password.label }} {{ form.password.label }}
{{ form.password }} {{ form.password(autocomplete="new-password") }}
<p class="field-desc weak">{% trans %}Enter a secure password that you do not use anywhere else.{% endtrans %}</p> <p class="field-desc weak">{% trans %}Enter a secure password that you do not use anywhere else.{% endtrans %}</p>
</div> </div>
<div class="f-ebox"> <div class="f-ebox">
{{ form.password_confirm.label }} {{ form.password_confirm.label }}
{{ form.password_confirm }} {{ form.password_confirm(autocomplete="new-password") }}
</div> </div>
<div class="f-bbox"> <div class="f-bbox">
{%- call form_button("done", form.action_register, class="primary") -%}{%- endcall -%} {%- call form_button("done", form.action_register, class="primary") -%}{%- endcall -%}

View File

@@ -17,11 +17,11 @@
{%- call render_errors(form) %}{% endcall -%} {%- call render_errors(form) %}{% endcall -%}
<div class="f-ebox"> <div class="f-ebox">
{{ form.password.label }} {{ form.password.label }}
{{ form.password }} {{ form.password(autocomplete="new-password") }}
</div> </div>
<div class="f-ebox"> <div class="f-ebox">
{{ form.password_confirm.label }} {{ form.password_confirm.label }}
{{ form.password_confirm }} {{ form.password_confirm(autocomplete="new-password") }}
</div> </div>
<div class="f-bbox"> <div class="f-bbox">
{%- call form_button("passwd", form.action_reset, class="primary") -%}{%- endcall -%} {%- call form_button("passwd", form.action_reset, class="primary") -%}{%- endcall -%}

View File

@@ -9,15 +9,15 @@
{%- endcall -%} {%- endcall -%}
<div class="f-ebox"> <div class="f-ebox">
{{ form.current_password.label(class="required") }} {{ form.current_password.label(class="required") }}
{{ form.current_password(class=("has-error" if form.current_password.name in form.errors else "")) }} {{ form.current_password(class=("has-error" if form.current_password.name in form.errors else ""), autocomplete="current-password") }}
</div> </div>
<div class="f-ebox"> <div class="f-ebox">
{{ form.new_password.label(class="required") }} {{ form.new_password.label(class="required") }}
{{ form.new_password }} {{ form.new_password(autocomplete="new-password") }}
</div> </div>
<div class="f-ebox"> <div class="f-ebox">
{{ form.new_password_confirm.label(class="required") }} {{ form.new_password_confirm.label(class="required") }}
{{ form.new_password_confirm(class=("has-error" if form.new_password_confirm.name in form.errors else "")) }} {{ form.new_password_confirm(class=("has-error" if form.new_password_confirm.name in form.errors else ""), autocomplete="new-password") }}
</div> </div>
<div class="box warning"> <div class="box warning">
<header>{% trans %}Warning{% endtrans %}</header> <header>{% trans %}Warning{% endtrans %}</header>