Commit fcf35d94 authored by Lysander Trischler's avatar Lysander Trischler

Use API password auth also on POST

parent 041e6941
......@@ -813,6 +813,7 @@ if __name__ == "__main__":
user = tornadyse.isobeef_ldap_auth(self, username, password)
if user is not None:
return user
logging.debug("IsoBeef LDAP auth failed, trying API password auth!")
user = self.db.get("""SELECT username, display_name
FROM users
WHERE username = %s AND api_password = %s
......@@ -821,6 +822,7 @@ if __name__ == "__main__":
kraftwerk_api_password_hash(username, password))
if user is not None:
return tornadyse.DummyIsoBeefLDAPUser(**user)
logging.warn("Both IsoBeef LDAP auth and API password auth failed for user %r!" % username)
return None
......@@ -879,7 +881,7 @@ if __name__ == "__main__":
def post(self):
data = self.get_json()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment