CuriousLearner / django-phone-verify

A Django app to support phone number verification using security code / One-Time-Password (OTP) sent via SMS.
https://www.sanyamkhurana.com/django-phone-verify/
GNU General Public License v3.0
258 stars 61 forks source link

Failing on BaseBacked.generate_session_token() #51

Closed lfx closed 3 years ago

lfx commented 3 years ago

Hello,

I think I found bug here: https://github.com/CuriousLearner/django-phone-verify/blob/eb1c970981a91dbf6f550560e4daf586e699b3e3/phone_verify/backends/base.py#L52

jwt.encode(data, django_settings.SECRET_KEY) returns string, so decode() method is not found, therefore call fails.

Tested on python 3.8.5 and 3.8.6.

Btw, super useful lib, thank you for creating! 👍

sabuj7177 commented 3 years ago

I also faced a similar problem. This resolves when ".decode()" is removed from base.py file. Any solution or update?

CuriousLearner commented 3 years ago

I would look into this soon-ish and also welcome others to add a pull request.

Thanks!

m7salam commented 3 years ago

@CuriousLearner I have provided a pull request here https://github.com/CuriousLearner/django-phone-verify/pull/53 to solve this problem

it solved it for me and working now

hopefully you can merge it soon

have a great day and thanks for the great library

vhawk19 commented 3 years ago

@CuriousLearner Would #53 be merged soon?

CuriousLearner commented 3 years ago

Depends on when is it ready with a fix.

Tobeyforce commented 3 years ago

@CuriousLearner Status on this? Python 3.8.5, 3.9.1 still not working. Would love to see compatability fixed :) Crossing my fingers.

CuriousLearner commented 3 years ago

Shall be fixed in #58

CuriousLearner commented 3 years ago

Released django-phone-verify v2.0.1 (https://pypi.org/project/django-phone-verify/2.0.1/) and this issue has been fixed.

We now support Py{36,37,38,39} with Django{20,21,22,30,31}.

Thank you everyone (@lfx @m7salam @vhawk19 @sabuj7177 @Tobeyforce @belal-bh ) for their inputs!