{"action":"created","issue":{"url":"https://api.github.com/repos/Bouke/django-two-factor-auth/issues/145","repository_url":"https://api.github.com/repos/Bouke/django-two-factor-auth","labels_url":"https://api.github.com/repos/Bouke/django-two-factor-auth/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/Bouke/django-two-factor-auth/issues/145/comments","events_url":"https://api.github.com/repos/Bouke/django-two-factor-auth/issues/145/events","html_url":"https://github.com/Bouke/django-two-factor-auth/issues/145","id":143822795,"number":145,"title":"`addstatictoken` from Django-OTP doesn't always work with BackupView etc.","user":{"login":"moggers87","id":1490673,"avatar_url":"https://avatars.githubusercontent.com/u/1490673?v=3","gravatar_id":"","url":"https://api.github.com/users/moggers87","html_url":"https://github.com/moggers87","followers_url":"https://api.github.com/users/moggers87/followers","following_url":"https://api.github.com/users/moggers87/following{/other_user}","gists_url":"https://api.github.com/users/moggers87/gists{/gist_id}","starred_url":"https://api.github.com/users/moggers87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moggers87/subscriptions","organizations_url":"https://api.github.com/users/moggers87/orgs","repos_url":"https://api.github.com/users/moggers87/repos","events_url":"https://api.github.com/users/moggers87/events{/privacy}","received_events_url":"https://api.github.com/users/moggers87/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-27T15:53:18Z","updated_at":"2016-03-28T13:45:00Z","closed_at":null,"body":"This is partly a bug with Django-OTP. [See this PR](https://bitbucket.org/psagers/django-otp/pull-requests/18/expose-default-static-device-name-used-by/diff)\r\n\r\nIf the specified user has already generated backup tokens (and thus has a StaticDevice), then `addstatictoken` will behave as expected - the user gets a new backup token.\r\n\r\nHowever, if the user didn't previously, the command will create a StaticDevice with the name \"Backup Code\". Django Two-Factor Authentication has the name \"backup\" hardcoded into all its views and so never sees the newly created token.\r\n\r\ntl;dr: D2FA and Django-OTP have hardcoded different names for backup tokens."},"comment":{"url":"https://api.github.com/repos/Bouke/django-two-factor-auth/issues/comments/202399704","html_url":"https://github.com/Bouke/django-two-factor-auth/issues/145#issuecomment-202399704","issue_url":"https://api.github.com/repos/Bouke/django-two-factor-auth/issues/145","id":202399704,"user":{"login":"moggers87","id":1490673,"avatar_url":"https://avatars.githubusercontent.com/u/1490673?v=3","gravatar_id":"","url":"https://api.github.com/users/moggers87","html_url":"https://github.com/moggers87","followers_url":"https://api.github.com/users/moggers87/followers","following_url":"https://api.github.com/users/moggers87/following{/other_user}","gists_url":"https://api.github.com/users/moggers87/gists{/gist_id}","starred_url":"https://api.github.com/users/moggers87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moggers87/subscriptions","organizations_url":"https://api.github.com/users/moggers87/orgs","repos_url":"https://api.github.com/users/moggers87/repos","events_url":"https://api.github.com/users/moggers87/events{/privacy}","received_events_url":"https://api.github.com/users/moggers87/received_events","type":"User","site_admin":false},"created_at":"2016-03-28T13:45:00Z","updated_at":"2016-03-28T13:45:00Z","body":"Having thought about this some more, I'm wondering why D2FA views only look for a single StaticDevice - is there actually a use-case where a user would have backup and not-backup tokens?"}}