Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

How to implement OTP based verification before letting the user to create a new password using pyotp?

$
0
0

I am very new to Django rest framework. I am building APIs for my mobile application.In forgot password module, I have the below flow

  1. Ask user to enter mobile
  2. check existence
  3. If exists - > send OTP
  4. Verify and let user create a new password.

But in this case, I would like to know the way of handle the below situation.

When one user requests otp and waiting for it to verify, meanwhile another user requests for OTPAt this time, how to handle the both users?I thought of

  1. creating the dictionary and save the user id as key and otp as value in views.py to verify particular user.
  2. store the otp temporarily until it verifies.

Which is the secured way and any alternative for this kind of scenario?


Viewing all articles
Browse latest Browse all 23131

Trending Articles