Skip to content

Conversation

@nnseva
Copy link
Contributor

@nnseva nnseva commented Oct 14, 2022

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 command addstatictoken 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 the two_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 the addstatictoken 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@moggers87 moggers87 self-requested a review February 26, 2024 02:51
Copy link
Collaborator

@moggers87 moggers87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor change required, otherwise looks good 👍

@nnseva
Copy link
Contributor Author

nnseva commented Feb 24, 2025

@moggers87 done

@nnseva nnseva requested a review from moggers87 February 24, 2025 14:06
Copy link
Collaborator

@moggers87 moggers87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@moggers87 moggers87 merged commit 7cdeb67 into jazzband:master Feb 24, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants