Commit daff3d8d authored by Chris Lamb's avatar Chris Lamb
Browse files

Show raw 2FA key so you can copy-paste it when on mobile. (Closes: #34)

parent 5be82bc9
......@@ -39,6 +39,14 @@ class SetupView(two_factor_views.SetupView):
success_url = 'account:two-factor-auth:enabled'
template_name = 'account/two_factor_auth/setup.html'
def get_context_data(self, form, **kwargs):
context = super().get_context_data(form, **kwargs)
if self.steps.current == 'generator':
context['qr_key'] = self.request.session[self.session_key_name]
return context
@class_view_decorator(login_required)
class QRGeneratorView(two_factor_views.QRGeneratorView):
......
......@@ -55,6 +55,11 @@
</div>
<button class="btn btn-primary btn-lg" type="submit">Validate token</button>
<p class="mt-5">
Alternatively, you can copy-paste the following code:
<strong>{{ qr_key }}</strong>
</p>
{% endcase %}
{% endswitch %}
</form>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment