i don't know if there is way to do this through settings but i
invented my own method to log in a user after verification. the user
has registered and thus has a row in auth_user.
in the model:
auth.settings.registration_requires_verification = True
auth.settings.verify_email_next = '/init/default/verifiedPage'
auth.settings.verify_email_onaccept = lambda form: __afterVerify(form)
def __afterVerify(form):
# find the user and log him/her in
user = db.auth_user[form.id]
__logInUser(user)
# separated this function in case it could be useful elsewhere
def __logInUser(user):
from gluon.storage import Storage
session.auth = Storage(user=user, last_visit=request.now,
expiration=auth.settings.expiration)
On Nov 17, 1:26 pm, mattynoce <[email protected]> wrote:
> hi, i hope this is an easy question, but i didn't find answers
> elsewhere in the forum.
>
> here's what i'm looking to do:
>
> 1) a parent registers with the site
> 2) the parent registers her child using just an email address
> 3) the child receives the verification email, and clicks on the link
> 4) the child then finishes the rest of the registration
>
> the part i'm having trouble with is the transition from (3) to (4). in
> (2) i was able to do a custom form to create the user and populate the
> registration_key field, no problem. but what i would like to do is
> have clicking on the verification link actually log in the user, and
> then use updates to set the rest of the variables.
>
> this isn't a security risk because it's just registration and there's
> no data about the child in the system. basically, i want the child to
> be logged in BEFORE having to set a password, then change it inside.
> is there a command i can use that will log a user in, or a way to set
> verification to automatically log in a user?
>
> thanks,
>
> matt