django-allauth icon indicating copy to clipboard operation
django-allauth copied to clipboard

6 digit verification for email address verification

Open webpn opened this issue 5 years ago • 22 comments

feature-request

6 digit code verification has recently become a common practice: instead of having the user click on a verification link, you email him a 6 digits code that he has to write down in the final step of the sign-up form. This is quite useful when the user is using a computer where he cannot easily read his email (so he could read the 6 digits code on his phone), or vice versa.

Ideally, it would be great to enable both methods: in order to verify the user email address you send him the verification link and the 6 digits code, so that the user can choose which method is easier for him.

webpn avatar Jul 10 '18 21:07 webpn

Any workaround for this?

hafizSiddiq7675 avatar May 06 '20 19:05 hafizSiddiq7675

anybody working on this?

ayushin avatar May 30 '20 08:05 ayushin

I'm also looking to try and do the same thing. If anyone comes up with a clean production-ready solution, please share!

khylbom avatar Jun 02 '20 19:06 khylbom

I think this is critical to avoid users losing track of the confirmation email and if it's going to SPAM, catching it early on.

ebarojas avatar Nov 06 '20 00:11 ebarojas

Linking the following issue since it relates:

https://github.com/pennersr/django-allauth/issues/2814

9mido avatar May 28 '21 04:05 9mido

+1

bene25 avatar Feb 16 '22 13:02 bene25

we use django-otp

ayushin avatar Feb 16 '22 13:02 ayushin

django-otp

are you using it with rest?

bene25 avatar Feb 16 '22 13:02 bene25

yes, but allauth + dj-rest-auth + otp requires a lot of tweaking as we use it together with drf-yasg

basically allauth is not really drf friendly and dj-rest-auth breaks all drf-yasg shemas

time for a big refactor?

ayushin avatar Feb 16 '22 13:02 ayushin

This issue is a good feature request.

@pennersr how do you feel about moderating off topic comments? Pretty uncommon in your project but this issue is full of it.

derek-adair avatar Sep 18 '23 02:09 derek-adair

One should check django-otp and django-df-auth

ayushin avatar Sep 18 '23 06:09 ayushin

If django-allauth integrates with that out of the box this can probably be closed and mentioned in the docs as the recommended solution for such a thing.

derek-adair avatar Sep 18 '23 11:09 derek-adair

@derek-adair I would argue that a lot more people use dj-rest-auth than django-df-auth, so it would be great to have a solution that works with dj-rest-auth as well.

olarcher avatar Sep 25 '23 19:09 olarcher

Not sure what you are arguing. I'm dispassionate about which of these allauth would support. My comment was simply that we should look at what, if anything, can be done to make these projects play nice together. For example, if someone could post up an example / tutorial / whatever of what kind of problems people have working with these projects togther that would be a great start!

Also @ayushin how is it that django allauth does not play nice w/ DRF? I have active projects that use allauth and django together and have no issues.

derek-adair avatar Sep 26 '23 11:09 derek-adair

Hello, Can anyone who has successfully integrated django OTP and allauth share some code samples? I want to send OTP on user login, redirect them to OTP confirmation page, verify the OTP and then send them to their dashboard.

This system works with allauth right now, except for the login OTP part. @ayushin @webpn @derek-adair

P.S. I am using Django template, not DRF.

josylad avatar Dec 06 '23 20:12 josylad

@josylad Just to be sure I fully understand, what you are referring to -- sending a OTP on login -- is something different from using a OTP for email verification, right? So, I think there are 2 distinct feature requests here:

  • Being able to confirm email addresses with a simple code (instead of following a link as is now).
  • Using your email as a 2nd factor, so that on each login you are sent a OTP that you will have to confirm.

pennersr avatar Dec 07 '23 08:12 pennersr

@josylad Just to be sure I fully understand, what you are referring to -- sending a OTP on login -- is something different from using a OTP for email verification, right? So, I think there are 2 distinct feature requests here:

  • Being able to confirm email addresses with a simple code (instead of following a link as is now).
  • Using your email as a 2nd factor, so that on each login you are sent a OTP that you will have to confirm.

Yes, you are correct. @pennersr

josylad avatar Dec 07 '23 09:12 josylad

@josylad See #3550 -- feel free to provide your use case specifics there.

pennersr avatar Dec 07 '23 11:12 pennersr

@josylad See #3550 -- feel free to provide your use case specifics there.

Done, thanks.

josylad avatar Dec 07 '23 13:12 josylad

This would be awesome.

francosbenitez avatar Jan 07 '24 03:01 francosbenitez

I've been following the discussion on implementing a one-time code for email verification in django-allauth, and I'd like to offer a summary and some thoughts for further consideration.

In modern web applications, it's becoming increasingly common to verify a user's email address through a one-time code, as opposed to the traditional confirmation link. This approach ensures real-time verification of the email address before the completion of the registration process. It's particularly useful in scenarios where immediate verification is crucial and adds an additional layer of security.

A key point for discussion is whether entering this verification code should be mandatory or configurable via Django settings. This raises questions about how it would interact with the existing functionality of django-allauth.

krystofbe avatar Jan 17 '24 09:01 krystofbe

A key point for discussion is whether entering this verification code should be mandatory or configurable

Definitely configurable, as allauth is used in all sorts of context, and mandatory email verification by code is not applicable everywhere.

pennersr avatar Jan 17 '24 17:01 pennersr