Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customize login process using -- django allauth

I am using django-allauth to provide user login and authentication in my django project. And things were going smoothly till now, but I have come across two things which I do not know whether can be implemented in the current app. Any help is appreciated:

  1. If we give the following setting ACCOUNT_EMAIL_VERIFICATION = True then after singing up the user account is not active until the user activates the email link. But what I want to do is to allow the user to be logged in, but keep the account active temporarily. Let us say if the user does not activate the account using the link within 7 days, the account will be blocked.

  2. I want to allow the user to login using both the email and the username, is that possible? According to the current readme we can do only one of them.

Any kind of help is really appreciated.

Update

I have written a hack for the second problem and if you want you can check that out in my fork of django-alluth https://github.com/sachingupta006/django-allauth

like image 326
Sachin Avatar asked Jun 19 '26 05:06

Sachin


1 Answers

As for the first problem, the Email Confirmations app stores the data the confirmation has been sent; I'd schedule a cronjob that runs every day and deactivates all accounts which haven't been confirmed for 7 days.

like image 64
avramov Avatar answered Jun 21 '26 02:06

avramov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!