On 7/6/06, Owen Mead-Robins <[EMAIL PROTECTED]> wrote:
> New user has just finished entering their credentials in a sign-up
> form. Form submits and creates the account..... Now the system *should*
> "log them in" with their supplied credentials and take them to the main
> page, which requires the user to be logged in. Currently, after the
> account is created they have to login, and nobody likes entering
> information twice.
>
> What is the best way to login a user without having to use the login
> page? I'm not very familiar with TG IdentityManagement I don't want to
> make some stupid security screw-up.
# create user account
user = UserAcct(user_name=user_name, email_address=email, password=password)
# log in
identity.current_provider.validate_identity(user_name, password,
identity.current.visit_key)
# redirect 'em somewhere
turbogears.flash("Account created!")
turbogears.redirect("/")
Works for me.
Regards -- Andy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---