From 2799034d3226b2220bf9eb4217a62347f2dde788 Mon Sep 17 00:00:00 2001 From: quadrismegistus Date: Sun, 13 Sep 2020 14:07:36 +0100 Subject: [PATCH] updates --- komrade/backend/the_operator.py | 50 +++++++++++++-------------------- 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/komrade/backend/the_operator.py b/komrade/backend/the_operator.py index f027546..faab55a 100644 --- a/komrade/backend/the_operator.py +++ b/komrade/backend/the_operator.py @@ -172,36 +172,26 @@ class TheOperator(Operator): self.log('names did not match!') success = False # # check pubkey? - elif pubkey != pubkey_record: - self.log('pubkeys did not match!') - pass - # name, - # prefix='/pubkey/' - # )): - # success = False - - # # check secret login - # elif b64enc(secret_login) != b64enc(self.crypt_keys.get( - # b64enc(pubkey), - # prefix='/secret_login/' - # )): - # success = False - - # # otherwise we succeed - # else: - # success = True - - # ## return res - # if success: - # return { - # 'success': True, - # 'status':'Login succeeded.' - # } - # else: - # return { - # 'success': False, - # 'status':'Login failed.' - # } + elif uri != pubkey_record: + self.log('pubkeys did not match!',uri,pubkey_record) + success = False + elif secret_login != secret_record: + self.log('secrets did not match!') + success = False + else: + success = True + + ## return res + if success: + return { + 'success': True, + 'status':'Login succeeded.' + } + else: + return { + 'success': False, + 'status':'Login failed.' + } def register_new_user(self,name,pubkey,**data): # self.log('setting pubkey under name')