You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thus the outputh of the method is something like b'....' which is probabilly not what it was supposed to produce.
To address this issue the casting may be changed by using force_str from django.utils.encoding.
This will have as a drawback that old cookies will not be validated, but it can be addressed in the validate_remember_device_cookie method by checking if the value starts with b' and ends with '.
The text was updated successfully, but these errors were encountered:
sevdog
added a commit
to sevdog/django-two-factor-auth
that referenced
this issue
Feb 23, 2023
The method
hash_remember_device_cookie_key
performs a raw casting from bytes to string:django-two-factor-auth/two_factor/views/utils.py
Lines 293 to 294 in 52b78a7
Thus the outputh of the method is something like
b'....'
which is probabilly not what it was supposed to produce.To address this issue the casting may be changed by using
force_str
fromdjango.utils.encoding
.This will have as a drawback that old cookies will not be validated, but it can be addressed in the
validate_remember_device_cookie
method by checking if the value starts withb'
and ends with'
.The text was updated successfully, but these errors were encountered: