Comments (4)
Django-two-factor-auth doesn't require LOGIN_URL
to be configured to link to two_factor:login
, but it is advised to do so. By doing so, the OTP login flow will be used when a user with OTP enabled tries to login. For users with OTP disabled, there is no additional steps to provide OTP tokens.
Without setting LOGIN_URL
, the @otp_required
decorator (and the like), will still work. You'll be required however to point them to the correct URL for two_factor:login
. Does this solve your question?
from django-two-factor-auth.
In code base at various places this variable is in use settings.LOGIN_URL e.g
class AdminSiteOTPRequiredMixin(object):
def login(self, request, extra_context=None):
"""
Redirects to the site login page for the given HttpRequest.
"""
return redirect('%s?%s' % (
settings.LOGIN_URL,
urlencode({REDIRECT_FIELD_NAME: request.get_full_path()})
))
And as we are using this Login_url for another app so admin OTP decorator redirects towards here. and we just place TWO_FACTOR_PATCH_ADMIN=True in our settings.
from django-two-factor-auth.
You're correct; the code should not use LOGIN_URL, but should've used two_factor:login
. I've changed the code in those places. Please try the code from the master branch and let me know if it works for you.
from django-two-factor-auth.
Yeah, it's working as expected now. Thank you for quick fix.
from django-two-factor-auth.
Related Issues (20)
- computing phone method availability is done in different places using different criteria
- Is it possible to use django-two-factor-auth with django-rest-knox? Is there a guide somewhere? HOT 1
- Feature request: Setting to disable `two_factor` in dev HOT 2
- 'two_factor' is not a registered tag library HOT 2
- Feature: Enable Whatsapp as a method
- Feature request: Norwegian Bokmål (nb) Language HOT 1
- Django-otp 1.3.0 broke tests HOT 3
- Cookie validation raises BadSignature error after major Django upgrade HOT 1
- drf-spectacular does not show APIs HOT 3
- Two factor not working with django-auth-adfs
- Is there a migration guide for 1.15? HOT 2
- 'RemoteYubikeyDevice' object has no attribute 'throttle_reset'
- What is needed to upgrade to webauthn 2.0.0+? HOT 1
- Authenticating with backup token should remove token step from final form list HOT 1
- Feature request: Add support for using Twilio Verify instead of Twilio Messaging HOT 1
- Question: Is it possible to implement 2FA only for a specific site when you have multiple independent admin sites in django admin? HOT 2
- cannot import name 'is_safe_url' HOT 1
- Unhandled exception HOT 5
- Is it possible to extend the user model? HOT 2
- How to subclass AuthenticationTokenView and use it in a subclassed LoginView HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-two-factor-auth.