enable automatic login after email verification

50 views
Skip to first unread message

arihant daga

unread,
Nov 5, 2015, 8:54:55 AM11/5/15
to web2py-users
I want users to enable automatically login after email verification but not allowing them login right after registration before email verification.
Currently i have these settings.

auth.settings.registration_requires_verification = True
auth
.settings.login_after_registration = False
auth
.settings.registration_requires_approval = False
auth
.settings.verify_email_next=URL('default','index')


So right now it stops user after registering and send a verification email. When user clicks on the link he is taken to index page but is not logged in automatically. How ca i achieve login after email verification automatically?

Massimo Di Pierro

unread,
Nov 11, 2015, 10:04:15 AM11/11/15
to web2py-users
This is tricky to do without changing the current auth code. So I did, please check it:

auth.settings.login_once_after_registration = True

Massimo Di Pierro

unread,
Nov 11, 2015, 10:16:32 AM11/11/15
to web2py-users
Actually on a second thought....

auth.settings.registration_requires_verification = True
auth
.settings.login_after_registration = True

does what you asked already. No?
Reply all
Reply to author
Forward
0 new messages