1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-01 08:26:03 +00:00

fix(accounts): an OTP mail links to the QR code instead of holding its secret

The Lost OTP? page, open without a login, and the admin's Email OTP QR
code mailed the QR code itself: the TOTP secret then stayed in the
mailbox and on every server the mail passed. The mail now carries a
signed link, good for an hour, to a page that shows the QR code (not
cached); the page shows nothing for an old or altered link or a user
without a device. tr and zh too.
This commit is contained in:
catborise 2026-11-05 17:28:13 +03:00
parent c62de11147
commit c42f74b4ee
12 changed files with 314 additions and 279 deletions

View file

@ -35,6 +35,7 @@ ALLOWED_FOR_ANY_USER = {
"instances:states": "the VM list's poll: only the user's own instances",
"accounts:login": "login page",
"accounts:email_otp": "part of the login flow (its own issues are tracked separately)",
"accounts:otp_qr": "the OTP QR code a mailed link opens: only with that signed, hour-old-at-most link",
"accounts:logout": "logout",
"accounts:profile": "the user's own profile",
"accounts:change_password": "the user's own password; new users get the permission by default",
@ -64,6 +65,7 @@ ALLOWED_FOR_ANY_USER = {
ALLOWED_FOR_ANONYMOUS = {
"accounts:login": "login page",
"accounts:email_otp": "part of the login flow (its own issues are tracked separately)",
"accounts:otp_qr": "the OTP QR code a mailed link opens: only with that signed, hour-old-at-most link",
"ds_openstack_index": "cloud-init datasource, fetched by VMs that do not log in",
"ds_openstack_metadata": "cloud-init datasource, fetched by VMs that do not log in",
"ds_openstack_userdata": "cloud-init datasource, fetched by VMs that do not log in",