Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Email for Demo without TOTP #83

Closed
Cabalist opened this issue Sep 14, 2019 · 1 comment
Closed

Using Email for Demo without TOTP #83

Cabalist opened this issue Sep 14, 2019 · 1 comment

Comments

@Cabalist
Copy link

I am getting a crash when trying to use the otp_email by itself.

It appears the code calls allauth_2fa.utils.user_has_valid_totp_device() without checking to see which device(s) are installed. Since in our demo app we just have 'django_otp.plugins.otp_email', and none of the others devices installed we get the following error relation "django_otp_totpdevice" does not exist

Adding 'django_otp.plugins.otp_totp', to the INSTALLED_APP fixes this issue but then pushes the user through the TOTP flow instead of using email.

Given that there are other devices in the django_otp ecosystem (HOTP, Static, etc) it might be worthwhile to have user_has_valid_totp_device() replaced by something more generic user_has_valid_device with some logic to detect the install apps.

@clokep
Copy link
Collaborator

clokep commented Sep 16, 2019

This seems related to #23. The current code has some assumptions that TOTP wants to be enabled. If you can figure out a good way to generalize this, I'd be happy to include any changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants