From cb18f038805d1e74361cf11405b4ca707c4e8627 Mon Sep 17 00:00:00 2001 From: Gabriel Hurley Date: Thu, 15 Mar 2012 15:24:32 -0700 Subject: [PATCH] Clears session if login fails unexepctedly. Fixes bug 956493. Change-Id: I1435d6beb2142d22c9357399c761a12d9969edbb --- horizon/views/auth_forms.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/horizon/views/auth_forms.py b/horizon/views/auth_forms.py index dedc10bb9..6da6546e7 100644 --- a/horizon/views/auth_forms.py +++ b/horizon/views/auth_forms.py @@ -117,7 +117,9 @@ class Login(forms.SelfHandlingForm): _('Invalid user name or password.')) except: # If we get here we don't want to show a stack trace to the - # user. + # user. However, if we fail here, there may be bad session + # data that's been cached already. + request.session.clear() exceptions.handle(request, message=_("An error occurred authenticating." " Please try again later."),