Identity: logging in when registering for a new account

2 views
Skip to first unread message

mgaiman

unread,
May 18, 2006, 2:21:11 PM5/18/06
to TurboGears
Hi all,

I'm using the identity framework in my webapp. I have a user
registration page that lets users sign up and I want automatically log
users in once they've signed up.

After much poking around in the identity source, I got the following
code to work:

ident = identity.current_provider.validate_identity(new_user_name,
password, turbogears.visit.current().key)
identity.set_current_identity(ident)
identity.set_current_provider(identity.current_provider)

Is there a cleaner way?

Andrew Grover

unread,
May 18, 2006, 6:29:54 PM5/18/06
to turbo...@googlegroups.com

I just do:
identity.current_provider.validate_identity(user_name, password,
identity.current.visit_key)

Seems to work without the last 2 lines.

Regards -- Andy

Reply all
Reply to author
Forward
0 new messages