Skip to content
Snippets Groups Projects
Commit 8abad491 authored by Shamil K Muhammed's avatar Shamil K Muhammed
Browse files

Fix errors (`port` and `localpart`)

`port` was supposed to be `db_port`
`user_id` is `@localpart:hs_bare` not `localpart:hs_bare`

It should work now.
parent 0a1abea0
Branches
No related merge requests found
...@@ -39,13 +39,13 @@ class DiasporaAuthProvider: ...@@ -39,13 +39,13 @@ class DiasporaAuthProvider:
user=self.config.db_username, user=self.config.db_username,
password=self.config.db_password, password=self.config.db_password,
host=self.config.db_host, host=self.config.db_host,
port=self.config.port port=self.config.db_port
) )
@defer.inlineCallbacks @defer.inlineCallbacks
def check_password(self, user_id, password): def check_password(self, user_id, password):
# user_id is localpart:hs_bare. we only need the localpart. # user_id is @localpart:hs_bare. we only need the localpart.
local_part = user_id.split(':', 1)[0] local_part = user_id.split(':', 1)[0][1:]
logger.info("Checking if user {} exists.".format(local_part)) logger.info("Checking if user {} exists.".format(local_part))
with self.connection.cursor() as cursor: with self.connection.cursor() as cursor:
yield threads.deferToThread( # Don't think this is needed, but w/e yield threads.deferToThread( # Don't think this is needed, but w/e
......
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