Account verification

73 views
Skip to first unread message

Kennedy Akogo

unread,
May 13, 2024, 8:28:01 AMMay 13
to django...@googlegroups.com
I'm attempting to implement a registration system with email verification. While the email verification functionality is working - sending an email to the user for verification - I'm encountering an issue where users are able to log in even without verifying their email addresses.

My goal is to restrict login functionality for users who haven't verified their email addresses. In other words, users should only be able to log in if they have completed the email verification process.

Please advise ,I have attached images of the login and register view 


IMG_20240513_045526_208.jpg
IMG_20240513_045525_749.jpg

Anthony Flury

unread,
May 13, 2024, 8:37:59 AMMay 13
to django...@googlegroups.com
Your register view is setting is_active to True - regardless of email verification.

Remember that the email confirmation will happen asynchronously to the registration.

What I do is have a separate table that records that a user needs to complete the verification process.
So registration sends the email (with a link) to the user and adds a record to the verification pending table.

I then have the verification view which sets the user to be Active and deleted the record in the pending table.



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJBDwusqGZXgHHg55uOvh_9h1VB8D3o1pxfLPcaJTJHViXrwZg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages