diff --git a/tailbone/api/auth.py b/tailbone/api/auth.py index 07c4464d..bf87be27 100644 --- a/tailbone/api/auth.py +++ b/tailbone/api/auth.py @@ -82,13 +82,16 @@ class AuthenticationView(APIView): if not (username and password): return {'error': "Invalid username or password"} - user = authenticate_user(Session(), username, password) + user = self.authenticate_user(username, password) if not user: return {'error': "Invalid username or password"} login_user(self.request, user) return self.user_info(user) + def authenticate_user(self, username, password): + return authenticate_user(Session(), username, password) + @api def logout(self): """