diff options
| author | Dennis Fink | 2026-11-17 21:23:57 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-17 21:23:57 +0100 |
| commit | acd1f42847786963fc4aaeed884c3091700c9e35 (patch) | |
| tree | 5a126bdfd96e69c985137bb2a3db8d9066ecd12d /webmentions_ssg/templates | |
| parent | c4c17e3e046a627a7d2353c734bc69f05d4fc3b1 (diff) | |
| download | webmentions-ssg-acd1f42847786963fc4aaeed884c3091700c9e35.tar.gz webmentions-ssg-acd1f42847786963fc4aaeed884c3091700c9e35.zip | |
feat(core): add user account page
Add an authenticated user page showing the current username and remote
address, including guidance for validating reverse-proxy hop
configuration.
Allow users to change their own password through a CSRF-protected
WTForms form while preserving the active session and invalidating other
existing sessions.
Diffstat (limited to '')
| -rw-r--r-- | webmentions_ssg/templates/base.html | 2 | ||||
| -rw-r--r-- | webmentions_ssg/templates/user.html | 35 |
2 files changed, 37 insertions, 0 deletions
diff --git a/webmentions_ssg/templates/base.html b/webmentions_ssg/templates/base.html index c7af077..4fffb38 100644 --- a/webmentions_ssg/templates/base.html +++ b/webmentions_ssg/templates/base.html @@ -49,6 +49,8 @@ SPDX-License-Identifier: BSD-3-Clause href="{{ url_for('webmentions.moderation') }}">Source rules</a> <a class="nav-link{% if request.endpoint == 'webmentions.source_list' %} active{% endif %}" href='{{ url_for("webmentions.source_list") }}'>Sent</a> + <a class="nav-link{% if request.endpoint == 'webmentions.user_page' %} active{% endif %}" + href="{{ url_for('webmentions.user_page') }}">User</a> <form action="{{ url_for('webmentions.logout') }}" method="post" class="m-0"> diff --git a/webmentions_ssg/templates/user.html b/webmentions_ssg/templates/user.html new file mode 100644 index 0000000..ecd5ba9 --- /dev/null +++ b/webmentions_ssg/templates/user.html @@ -0,0 +1,35 @@ +<!-- +SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me> + +SPDX-License-Identifier: BSD-3-Clause +--> +{% extends "base.html" %} + +{% set title = "User" %} +{% from "bootstrap5/form.html" import render_form %} + +{% block content %} + <h1 class="mb-4">User</h1> + <section class="mb-4" aria-labelledby="account-heading"> + <h2 class="h4" id="account-heading">Account</h2> + <dl class="row"> + <dt class="col-sm-3">Username</dt> + <dd class="col-sm-9"> + {{ current_user.username }} + </dd> + <dt class="col-sm-3">Remote address</dt> + <dd class="col-sm-9"> + <code>{{ remote_address or "Unavailable" }}</code> + </dd> + </dl> + <p class="text-body-secondary"> + The remote address is the client IP seen by the application for this request. + If it shows your reverse proxy instead, check the + <code>PROXY_FIX_TRUSTED_HOPS</code> configuration. + </p> + </section> + <section aria-labelledby="password-heading"> + <h2 class="h4" id="password-heading">Change password</h2> + <div class="col-12 col-sm-8 col-md-6 col-lg-4">{{ render_form(form) }}</div> + </section> +{% endblock %} |
