You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.5 KiB

  1. <h4 class="ui top attached header">
  2. {{.i18n.Tr "settings.twofa"}}
  3. </h4>
  4. <div class="ui attached segment">
  5. <p>{{.i18n.Tr "settings.twofa_desc"}}</p>
  6. {{if .TwofaEnrolled}}
  7. <p>{{$.i18n.Tr "settings.twofa_is_enrolled" | Str2html }}</p>
  8. <form class="ui form" action="{{AppSubUrl}}/user/settings/security/two_factor/regenerate_scratch" method="post" enctype="multipart/form-data">
  9. {{.CsrfTokenHtml}}
  10. <p>{{.i18n.Tr "settings.regenerate_scratch_token_desc"}}</p>
  11. <button class="ui blue button">{{$.i18n.Tr "settings.twofa_scratch_token_regenerate"}}</button>
  12. </form>
  13. <form class="ui form" action="{{AppSubUrl}}/user/settings/security/two_factor/disable" method="post" enctype="multipart/form-data" id="disable-form">
  14. {{.CsrfTokenHtml}}
  15. <p>{{.i18n.Tr "settings.twofa_disable_note"}}</p>
  16. <div class="ui red button delete-button" id="disable-twofa" data-type="form" data-form="#disable-form">{{$.i18n.Tr "settings.twofa_disable"}}</div>
  17. </form>
  18. {{else}}
  19. <p>{{.i18n.Tr "settings.twofa_not_enrolled"}}</p>
  20. <div class="inline field">
  21. <a class="ui green button" href="{{AppSubUrl}}/user/settings/security/two_factor/enroll">{{$.i18n.Tr "settings.twofa_enroll"}}</a>
  22. </div>
  23. {{end}}
  24. </div>
  25. <div class="ui small basic delete modal" id="disable-twofa">
  26. <div class="ui icon header">
  27. <i class="trash icon"></i>
  28. {{.i18n.Tr "settings.twofa_disable"}}
  29. </div>
  30. <div class="content">
  31. <p>{{.i18n.Tr "settings.twofa_disable_desc"}}</p>
  32. </div>
  33. {{template "base/delete_modal_actions" .}}
  34. </div>