Skip to content
Snippets Groups Projects
Verified Commit c146b392 authored by Mark's avatar Mark
Browse files

Fix bugs caused by merge

parent 3ca1bfd9
No related branches found
No related tags found
1 merge request!7Integration user panel
......@@ -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:
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment