issue #145 fix to use any static backup device instead of strictly named #560
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Now any static OTP device can be used as a backup OTP device instead of one strictly having the name
'backup'
.Motivation and Context
The
django_otp.plugins.otp_static
package has a management commandaddstatictoken
to create a special backup static token that could be used for the OTP backup process.As described in issue #145 the
addstatictoken
creates a static device named differently from the static device default name used in thetwo_factor
package, if no other backup devices are present for the user yet. Because of that, no backup button is shown while login in when the backup code has been created by theaddstatictoken
management command.How Has This Been Tested?
Two unit tests have been created altering backup static OTP device names in existing ones.
You can check working the patch yourself. Create your own project using the package, and look at the login process. An unpatched package doesn't show the backup button if the backup code has been created by the
addstatictoken
management command, while the patched one does.Types of changes
Checklist: