From 4659d3473b9c85e096b6e577fdccad9aa5cef248 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 2 Feb 2017 16:50:38 -0600 Subject: [PATCH] Let project override user authentication for login page --- tailbone/views/auth.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tailbone/views/auth.py b/tailbone/views/auth.py index 2b4cca73..13c27ca4 100644 --- a/tailbone/views/auth.py +++ b/tailbone/views/auth.py @@ -103,9 +103,8 @@ class AuthenticationView(View): form = forms.SimpleForm(self.request, UserLogin) if form.validate(): - user = authenticate_user(Session(), - form.data['username'], - form.data['password']) + user = self.authenticate_user(form.data['username'], + form.data['password']) if user: # okay now they're truly logged in headers = remember(self.request, user.uuid) @@ -121,6 +120,9 @@ class AuthenticationView(View): 'dialog': mobile, } + def authenticate_user(self, username, password): + return authenticate_user(Session(), username, password) + def mobile_login(self): return self.login(mobile=True)