[PR #378] [MERGED] OTP improvements #341 #529

Closed
opened 2026-02-27 15:59:03 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/retspen/webvirtcloud/pull/378
Author: @Real-Gecko
Created: 10/19/2020
Status: Merged
Merged: 10/20/2020
Merged by: @catborise

Base: masterHead: master


📝 Commits (2)

  • 5a19f0c OTP improvements
  • 1f26bd0 Do not send email if user email is not set

📊 Changes

13 files changed (+187 additions, -151 deletions)

View changed files

📝 accounts/forms.py (+5 -1)
📝 accounts/templates/account.html (+9 -13)
accounts/templates/accounts/email/otp.html (+7 -0)
accounts/templates/accounts/email_otp_form.html (+32 -0)
📝 accounts/templates/accounts/otp_login.html (+23 -55)
accounts/templates/base_auth.html (+0 -41)
📝 accounts/templates/login.html (+25 -20)
📝 accounts/urls.py (+9 -5)
📝 accounts/utils.py (+23 -0)
📝 accounts/views.py (+44 -9)
📝 admin/views.py (+6 -7)
📝 templates/base.html (+2 -0)
📝 webvirtcloud/settings.py.template (+2 -0)

📄 Description

Improved OTP. Now if OTP is enabled there's a link on login form to get OTP via email:
image
Clicking on the link leads to OTP email form, where user must provide valid email to get OTP:
image
If user with such email exists email will be sent with users's OTP QR code. NOTE: message about successful email will be shown even if email does not belong to any user.
Superuser cannot see user's QR code anymore, instead there's a button that can be used to email QR code to user:
image
Note that following needs to be added to settings.py

LOGIN_REQUIRED_IGNORE_VIEW_NAMES = ['accounts:email_otp']

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/retspen/webvirtcloud/pull/378 **Author:** [@Real-Gecko](https://github.com/Real-Gecko) **Created:** 10/19/2020 **Status:** ✅ Merged **Merged:** 10/20/2020 **Merged by:** [@catborise](https://github.com/catborise) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`5a19f0c`](https://github.com/retspen/webvirtcloud/commit/5a19f0c949077fee6be31dc3cf7ac2ec7e11f4d6) OTP improvements - [`1f26bd0`](https://github.com/retspen/webvirtcloud/commit/1f26bd0c316813d9a1b03dd74e6231c4350753f0) Do not send email if user email is not set ### 📊 Changes **13 files changed** (+187 additions, -151 deletions) <details> <summary>View changed files</summary> 📝 `accounts/forms.py` (+5 -1) 📝 `accounts/templates/account.html` (+9 -13) ➕ `accounts/templates/accounts/email/otp.html` (+7 -0) ➕ `accounts/templates/accounts/email_otp_form.html` (+32 -0) 📝 `accounts/templates/accounts/otp_login.html` (+23 -55) ➖ `accounts/templates/base_auth.html` (+0 -41) 📝 `accounts/templates/login.html` (+25 -20) 📝 `accounts/urls.py` (+9 -5) 📝 `accounts/utils.py` (+23 -0) 📝 `accounts/views.py` (+44 -9) 📝 `admin/views.py` (+6 -7) 📝 `templates/base.html` (+2 -0) 📝 `webvirtcloud/settings.py.template` (+2 -0) </details> ### 📄 Description Improved OTP. Now if OTP is enabled there's a link on login form to get OTP via email: ![image](https://user-images.githubusercontent.com/2231969/96420525-6ef48b00-1217-11eb-97ee-c26fd39f4238.png) Clicking on the link leads to OTP email form, where user must provide valid email to get OTP: ![image](https://user-images.githubusercontent.com/2231969/96420634-8c295980-1217-11eb-874a-71a439325eb3.png) If user with such email exists email will be sent with users's OTP QR code. **NOTE**: message about successful email will be shown even if email does not belong to any user. Superuser cannot see user's QR code anymore, instead there's a button that can be used to email QR code to user: ![image](https://user-images.githubusercontent.com/2231969/96421183-43be6b80-1218-11eb-81f4-79f1ddeef477.png) Note that following needs to be added to settings.py ```python LOGIN_REQUIRED_IGNORE_VIEW_NAMES = ['accounts:email_otp'] ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 15:59:03 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtcloud#529
No description provided.