Hi,
When someone registers for my website, I would like for them to
authenticate automatically. I am using the default repoze.who/
repoze.what plugin for tg2. My code is as follows:
def newuser(self, **kwargs):
u = User()
u.user_name = kwargs['email']
u.email_address = kwargs['email']
u.password = kwargs['password1']
u.firstname = kwargs['firstname']
u.lastname = kwargs['lastname']
u.display_name = kwargs['firstname']
DBSession.add(u)
DBSession.flush()
identity = Identity(u.__dict__)
request.identity = identity
request.identity['user'] = u
request.environ['repoze.who.identity'] = identity
redirect('/')
I tried creating a new Identity from repoze.who.middleware and
assigning it request.identity and request.environ
['repoze.who.identity'], but when I redirect request.identity is still
None.
Thanks,
Rob
--
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?hl=en.