pycognito icon indicating copy to clipboard operation
pycognito copied to clipboard

Failing Registration prodecure

Open Arfius opened this issue 4 years ago • 3 comments

Hello, I got the following error during the registration procedure.

u.register(username, password) File "/site-packages/pycognito/init.py", line 350, in register self._add_secret_hash(params, "SecretHash") File "/site-packages/pycognito/init.py", line 695, in _add_secret_hash secret_hash = AWSSRP.get_secret_hash( File "site-packages/pycognito/aws_srp.py", line 201, in get_secret_hash message = bytearray(username + client_id, "utf-8") TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

The username has None value in get_secret_hash because the attribute passed via registrer function is not updating the self.username . To use the register procedure , i am passing the attribute username to the Cognito object, but this is not described in the documentation.

Arfius avatar Jan 26 '21 12:01 Arfius

There are really quite a few of these "var vs self.var" gotchas, @pvizeli. Is it worth re-evaluating where these variables are passed in vs consulting self and trying the normalize the way the library deals with them?

nk9 avatar Nov 26 '22 00:11 nk9

Also, this seems to be a duplicate of #17

nk9 avatar Nov 26 '22 00:11 nk9

There are really quite a few of these "var vs self.var" gotchas, @pvizeli. Is it worth re-evaluating where these variables are passed in vs consulting self and trying the normalize the way the library deals with them?

I'm open for suggestion.

pvizeli avatar Nov 26 '22 10:11 pvizeli