From 8abad4910f4c0dd62751db808377ed726b210c33 Mon Sep 17 00:00:00 2001
From: Shamil K Muhammed <noteness@disroot.org>
Date: Tue, 18 Apr 2017 01:31:07 +0530
Subject: [PATCH] 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.
---
 diaspora_auth_provider.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/diaspora_auth_provider.py b/diaspora_auth_provider.py
index f8a7568..217a858 100644
--- a/diaspora_auth_provider.py
+++ b/diaspora_auth_provider.py
@@ -39,13 +39,13 @@ class DiasporaAuthProvider:
             user=self.config.db_username,
             password=self.config.db_password,
             host=self.config.db_host,
-            port=self.config.port
+            port=self.config.db_port
         )
 
     @defer.inlineCallbacks
     def check_password(self, user_id, password):
-        # user_id is localpart:hs_bare. we only need the localpart.
-        local_part = user_id.split(':', 1)[0]
+        # user_id is @localpart:hs_bare. we only need the localpart.
+        local_part = user_id.split(':', 1)[0][1:]
         logger.info("Checking if user {} exists.".format(local_part))
         with self.connection.cursor() as cursor:
             yield threads.deferToThread( # Don't think this is needed, but w/e
-- 
GitLab