From c146b392d0a3cce3ebb0067a1f06a166f04b41b9 Mon Sep 17 00:00:00 2001 From: Mark <mark@openappstack.net> Date: Tue, 10 Dec 2019 21:15:00 +0100 Subject: [PATCH] Fix bugs caused by merge --- login_provider/app.py | 8 ++++---- login_provider/db.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/login_provider/app.py b/login_provider/app.py index d18ea65..162a681 100644 --- a/login_provider/app.py +++ b/login_provider/app.py @@ -40,12 +40,12 @@ def login(): challenge = login_form.challenge.data try: - login_request = hydra.login_request(challenge) + login_request = HYDRA.login_request(challenge) if login_request.skip: # Skip, if true, let's us know that Hydra has successfully authenticated the user # we should not show any UI and accept the request right away app.logger.info("{0} is already logged in. Skip authentication".format(login_request.subject)) - return redirect(hydra.login_request(challenge).accept(login_request.subject)) + return redirect(HYDRA.login_request(challenge).accept(login_request.subject)) except hydra_client.exceptions.NotFound: app.logger.error("Not Found. Login request not found. challenge={0}".format(challenge)) abort(404) @@ -56,10 +56,10 @@ def login(): if login_form.validate_on_submit(): user = User(login_form.username.data) if user.authenticate(login_form.password.data): - redirect_to = hydra.login_request(challenge).accept(user.username) + redirect_to = HYDRA.login_request(challenge).accept(user.username) app.logger.info("{0} logged in successfully".format(user.username)) else: - redirect_to = hydra.login_request(challenge).reject(user.username) + redirect_to = HYDRA.login_request(challenge).reject(user.username) app.logger.warning("{0} failed to login".format(user.username)) return redirect(redirect_to) else: diff --git a/login_provider/db.py b/login_provider/db.py index 52683c0..48dd850 100644 --- a/login_provider/db.py +++ b/login_provider/db.py @@ -45,7 +45,7 @@ class User(UserMixin): verifyPassword( username: "{0}", password: "{1}") - }}'''.fromat(self.username, password) + }}'''.format(self.username, password) result = json.loads(graphql_client.execute(querystring)) verified = False if "data" in result: -- GitLab