quickly sanitized account controller with plain error messages

git-svn-id: http://yolanda.mister-muffin.de/svn@372 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
josch 2008-08-16 08:28:52 +00:00
parent b6558fb1bf
commit 124c37f6f8

View file

@ -15,11 +15,11 @@ class AccountController(BaseController):
self.consumer = Consumer(self.openid_session, None)
openid = request.params.get('username', None)
if openid is None:
return render('/login/form.mako')
return "invalid openid"
try:
authrequest = self.consumer.begin(openid)
except DiscoveryFailure, e:
return render('/login/form.mako')
return "invalid openid"
redirecturl = authrequest.redirectURL(
h.url_for('',qualified=True),
@ -41,11 +41,10 @@ class AccountController(BaseController):
session.clear()
return redirect_to('/index')
else:
return redirect_to('/login')
return "openid auth error"
def logout(self):
c.title = 'logged out'
session.clear()
session.save()
return render('/login/logout.mako')
return redirect_to('/index')