rodauth 1.23.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +132 -0
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +207 -79
  5. data/doc/account_expiration.rdoc +12 -26
  6. data/doc/active_sessions.rdoc +49 -0
  7. data/doc/audit_logging.rdoc +44 -0
  8. data/doc/base.rdoc +74 -128
  9. data/doc/change_login.rdoc +7 -14
  10. data/doc/change_password.rdoc +9 -13
  11. data/doc/change_password_notify.rdoc +2 -2
  12. data/doc/close_account.rdoc +9 -16
  13. data/doc/confirm_password.rdoc +12 -5
  14. data/doc/create_account.rdoc +11 -22
  15. data/doc/disallow_password_reuse.rdoc +6 -13
  16. data/doc/email_auth.rdoc +15 -14
  17. data/doc/email_base.rdoc +5 -15
  18. data/doc/http_basic_auth.rdoc +10 -1
  19. data/doc/jwt.rdoc +22 -22
  20. data/doc/jwt_cors.rdoc +2 -3
  21. data/doc/jwt_refresh.rdoc +12 -8
  22. data/doc/lockout.rdoc +17 -15
  23. data/doc/login.rdoc +10 -2
  24. data/doc/login_password_requirements_base.rdoc +15 -37
  25. data/doc/logout.rdoc +2 -2
  26. data/doc/otp.rdoc +24 -19
  27. data/doc/password_complexity.rdoc +10 -26
  28. data/doc/password_expiration.rdoc +11 -25
  29. data/doc/password_grace_period.rdoc +16 -2
  30. data/doc/recovery_codes.rdoc +18 -12
  31. data/doc/release_notes/2.0.0.txt +361 -0
  32. data/doc/remember.rdoc +40 -64
  33. data/doc/reset_password.rdoc +12 -9
  34. data/doc/session_expiration.rdoc +1 -0
  35. data/doc/single_session.rdoc +16 -25
  36. data/doc/sms_codes.rdoc +24 -14
  37. data/doc/two_factor_base.rdoc +60 -22
  38. data/doc/verify_account.rdoc +14 -12
  39. data/doc/verify_account_grace_period.rdoc +6 -2
  40. data/doc/verify_login_change.rdoc +9 -8
  41. data/doc/webauthn.rdoc +115 -0
  42. data/doc/webauthn_login.rdoc +15 -0
  43. data/doc/webauthn_verify_account.rdoc +9 -0
  44. data/javascript/webauthn_auth.js +45 -0
  45. data/javascript/webauthn_setup.js +35 -0
  46. data/lib/roda/plugins/rodauth.rb +1 -1
  47. data/lib/rodauth.rb +29 -24
  48. data/lib/rodauth/features/account_expiration.rb +5 -5
  49. data/lib/rodauth/features/active_sessions.rb +160 -0
  50. data/lib/rodauth/features/audit_logging.rb +96 -0
  51. data/lib/rodauth/features/base.rb +131 -47
  52. data/lib/rodauth/features/change_password_notify.rb +1 -1
  53. data/lib/rodauth/features/confirm_password.rb +40 -2
  54. data/lib/rodauth/features/create_account.rb +7 -13
  55. data/lib/rodauth/features/disallow_common_passwords.rb +1 -1
  56. data/lib/rodauth/features/disallow_password_reuse.rb +1 -1
  57. data/lib/rodauth/features/email_auth.rb +29 -27
  58. data/lib/rodauth/features/email_base.rb +3 -3
  59. data/lib/rodauth/features/http_basic_auth.rb +44 -37
  60. data/lib/rodauth/features/jwt.rb +51 -8
  61. data/lib/rodauth/features/jwt_refresh.rb +3 -3
  62. data/lib/rodauth/features/lockout.rb +11 -13
  63. data/lib/rodauth/features/login.rb +48 -8
  64. data/lib/rodauth/features/login_password_requirements_base.rb +4 -4
  65. data/lib/rodauth/features/otp.rb +71 -81
  66. data/lib/rodauth/features/password_complexity.rb +4 -11
  67. data/lib/rodauth/features/password_expiration.rb +1 -1
  68. data/lib/rodauth/features/password_grace_period.rb +17 -10
  69. data/lib/rodauth/features/recovery_codes.rb +47 -51
  70. data/lib/rodauth/features/remember.rb +11 -27
  71. data/lib/rodauth/features/reset_password.rb +25 -25
  72. data/lib/rodauth/features/session_expiration.rb +6 -4
  73. data/lib/rodauth/features/single_session.rb +7 -5
  74. data/lib/rodauth/features/sms_codes.rb +58 -67
  75. data/lib/rodauth/features/two_factor_base.rb +132 -28
  76. data/lib/rodauth/features/verify_account.rb +23 -20
  77. data/lib/rodauth/features/verify_account_grace_period.rb +19 -8
  78. data/lib/rodauth/features/verify_login_change.rb +11 -10
  79. data/lib/rodauth/features/webauthn.rb +507 -0
  80. data/lib/rodauth/features/webauthn_login.rb +70 -0
  81. data/lib/rodauth/features/webauthn_verify_account.rb +46 -0
  82. data/lib/rodauth/version.rb +2 -2
  83. data/templates/button.str +1 -3
  84. data/templates/change-login.str +1 -2
  85. data/templates/change-password.str +3 -5
  86. data/templates/close-account.str +2 -2
  87. data/templates/confirm-password.str +1 -1
  88. data/templates/create-account.str +1 -1
  89. data/templates/email-auth-request-form.str +1 -2
  90. data/templates/email-auth.str +1 -1
  91. data/templates/global-logout-field.str +6 -0
  92. data/templates/login-confirm-field.str +2 -4
  93. data/templates/login-display.str +3 -2
  94. data/templates/login-field.str +2 -4
  95. data/templates/login-form-footer.str +6 -0
  96. data/templates/login-form.str +7 -0
  97. data/templates/login.str +1 -9
  98. data/templates/logout.str +1 -1
  99. data/templates/multi-phase-login.str +3 -0
  100. data/templates/otp-auth-code-field.str +5 -3
  101. data/templates/otp-auth.str +1 -1
  102. data/templates/otp-disable.str +1 -1
  103. data/templates/otp-setup.str +3 -3
  104. data/templates/password-confirm-field.str +2 -4
  105. data/templates/password-field.str +2 -4
  106. data/templates/recovery-auth.str +3 -6
  107. data/templates/recovery-codes.str +1 -1
  108. data/templates/remember.str +15 -20
  109. data/templates/reset-password-request.str +2 -2
  110. data/templates/reset-password.str +1 -2
  111. data/templates/sms-auth.str +1 -1
  112. data/templates/sms-code-field.str +5 -3
  113. data/templates/sms-confirm.str +1 -2
  114. data/templates/sms-disable.str +1 -2
  115. data/templates/sms-request.str +1 -1
  116. data/templates/sms-setup.str +6 -4
  117. data/templates/two-factor-auth.str +5 -0
  118. data/templates/two-factor-disable.str +6 -0
  119. data/templates/two-factor-manage.str +16 -0
  120. data/templates/unlock-account-request.str +2 -2
  121. data/templates/unlock-account.str +1 -1
  122. data/templates/verify-account-resend.str +1 -1
  123. data/templates/verify-account.str +1 -2
  124. data/templates/verify-login-change.str +1 -1
  125. data/templates/webauthn-auth.str +11 -0
  126. data/templates/webauthn-remove.str +14 -0
  127. data/templates/webauthn-setup.str +12 -0
  128. metadata +64 -11
  129. data/doc/verify_change_login.rdoc +0 -11
  130. data/lib/rodauth/features/verify_change_login.rb +0 -20
@@ -0,0 +1,70 @@
1
+ # frozen-string-literal: true
2
+
3
+ module Rodauth
4
+ Feature.define(:webauthn_login, :WebauthnLogin) do
5
+ depends :login, :webauthn
6
+
7
+ before
8
+
9
+ redirect(:webauthn_login_failure){require_login_redirect}
10
+
11
+ error_flash "There was an error authenticating via WebAuthn"
12
+
13
+ route(:webauthn_login) do |r|
14
+ check_already_logged_in
15
+ before_webauthn_login_route
16
+
17
+ r.post do
18
+ catch_error do
19
+ unless account_from_login(param(login_param)) && open_account?
20
+ throw_error_status(no_matching_login_error_status, login_param, no_matching_login_message)
21
+ end
22
+
23
+ webauthn_credential = webauthn_auth_credential_from_form_submission
24
+ before_webauthn_login
25
+ _login('webauthn') do
26
+ webauthn_update_session(webauthn_credential.id)
27
+ end
28
+ end
29
+
30
+ set_redirect_error_flash webauthn_login_error_flash
31
+ redirect webauthn_login_failure_redirect
32
+ end
33
+ end
34
+
35
+ def webauthn_auth_additional_form_tags
36
+ if @webauthn_login
37
+ super.to_s + login_hidden_field
38
+ else
39
+ super
40
+ end
41
+ end
42
+
43
+ def webauthn_auth_form_path
44
+ if @webauthn_login
45
+ webauthn_login_path
46
+ else
47
+ super
48
+ end
49
+ end
50
+
51
+ def use_multi_phase_login?
52
+ true
53
+ end
54
+
55
+ private
56
+
57
+ def _multi_phase_login_forms
58
+ forms = super
59
+ if valid_login_entered? && webauthn_setup?
60
+ @webauthn_login = true
61
+ forms << [20, render('webauthn-auth'), nil]
62
+ end
63
+ forms
64
+ end
65
+
66
+ def webauthn_account_id
67
+ super || account_id
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,46 @@
1
+ # frozen-string-literal: true
2
+
3
+ module Rodauth
4
+ Feature.define(:webauthn_verify_account, :WebauthnVerifyAccount) do
5
+ depends :verify_account, :webauthn
6
+
7
+ def verify_account_view
8
+ webauthn_setup_view
9
+ end
10
+
11
+ def create_account_set_password?
12
+ false
13
+ end
14
+
15
+ def verify_account_set_password?
16
+ false
17
+ end
18
+
19
+ def autologin_session(autologin_type)
20
+ super
21
+ if autologin_type == 'verify_account'
22
+ set_session_value(authenticated_by_session_key, ['webauthn'])
23
+ remove_session_value(autologin_type_session_key)
24
+ webauthn_update_session(@webauthn_credential.id)
25
+ end
26
+ end
27
+
28
+ private
29
+
30
+ def before_verify_account
31
+ super
32
+ if features.include?(:jwt) && use_jwt? && !param_or_nil(webauthn_setup_param)
33
+ cred = new_webauthn_credential
34
+ json_response[webauthn_setup_param] = cred.as_json
35
+ json_response[webauthn_setup_challenge_param] = cred.challenge
36
+ json_response[webauthn_setup_challenge_hmac_param] = compute_hmac(cred.challenge)
37
+ end
38
+ @webauthn_credential = webauthn_setup_credential_from_form_submission
39
+ add_webauthn_credential(@webauthn_credential)
40
+ end
41
+
42
+ def webauthn_account_id
43
+ super || account_id
44
+ end
45
+ end
46
+ end
@@ -3,10 +3,10 @@
3
3
  module Rodauth
4
4
  # The major version of Rodauth, updated only for major changes that are
5
5
  # likely to require modification to apps using Rodauth.
6
- MAJOR = 1
6
+ MAJOR = 2
7
7
 
8
8
  # The minor version of Rodauth, updated for new feature releases of Rodauth.
9
- MINOR = 23
9
+ MINOR = 0
10
10
 
11
11
  # The patch version of Rodauth, updated only for bug fixes from the last
12
12
  # feature release.
@@ -1,5 +1,3 @@
1
1
  <div class="form-group">
2
- <div class="col-sm-offset-2 col-sm-10">
3
- <input type="submit" #{"name=\"#{h opts[:name]}\"" if opts[:name]} class="#{h(opts[:class] || 'btn btn-primary')}" value="#{h value}"/>
4
- </div>
2
+ <input type="submit" #{"name=\"#{h opts[:name]}\"" if opts[:name]} class="#{h(opts[:class] || 'btn btn-primary')}" value="#{h value}"/>
5
3
  </div>
@@ -1,4 +1,4 @@
1
- <form method="post" class="rodauth form-horizontal" role="form" id="change-login-form">
1
+ <form method="post" class="rodauth" role="form" id="change-login-form">
2
2
  #{rodauth.change_login_additional_form_tags}
3
3
  #{rodauth.csrf_tag}
4
4
  #{rodauth.render('login-field')}
@@ -6,4 +6,3 @@
6
6
  #{rodauth.render('password-field') if rodauth.change_login_requires_password?}
7
7
  #{rodauth.button(rodauth.change_login_button)}
8
8
  </form>
9
-
@@ -1,12 +1,10 @@
1
- <form method="post" class="rodauth form-horizontal" role="form" id="change-password-form">
1
+ <form method="post" class="rodauth" role="form" id="change-password-form">
2
2
  #{rodauth.change_password_additional_form_tags}
3
3
  #{rodauth.csrf_tag}
4
4
  #{rodauth.render('password-field') if rodauth.change_password_requires_password?}
5
5
  <div class="form-group">
6
- <label class="col-sm-2 control-label" for="new-password">#{rodauth.new_password_label}#{rodauth.input_field_label_suffix}</label>
7
- <div class="col-sm-10">
8
- #{rodauth.input_field_string(rodauth.new_password_param, 'new-password', :type => 'password')}
9
- </div>
6
+ <label for="new-password">#{rodauth.new_password_label}#{rodauth.input_field_label_suffix}</label>
7
+ #{rodauth.input_field_string(rodauth.new_password_param, 'new-password', :type => 'password', :autocomplete=>"new-password")}
10
8
  </div>
11
9
  #{rodauth.render('password-confirm-field') if rodauth.require_password_confirmation?}
12
10
  #{rodauth.button(rodauth.change_password_button)}
@@ -1,6 +1,6 @@
1
- <form method="post" class="rodauth form-horizontal" role="form" id="close-account-form">
1
+ <form method="post" class="rodauth" role="form" id="close-account-form">
2
2
  #{rodauth.close_account_additional_form_tags}
3
3
  #{rodauth.csrf_tag}
4
4
  #{rodauth.render('password-field') if rodauth.close_account_requires_password?}
5
- #{rodauth.button(rodauth.close_account_button, :class=>'btn btn-warning')}
5
+ #{rodauth.button(rodauth.close_account_button, :class=>'btn btn-danger')}
6
6
  </form>
@@ -1,4 +1,4 @@
1
- <form method="post" class="rodauth form-horizontal" role="form" id="confirm-password-form">
1
+ <form method="post" class="rodauth" role="form" id="confirm-password-form">
2
2
  #{rodauth.confirm_password_additional_form_tags}
3
3
  #{rodauth.csrf_tag}
4
4
  #{rodauth.render('password-field')}
@@ -1,4 +1,4 @@
1
- <form method="post" class="rodauth form-horizontal" role="form" id="create-account-form">
1
+ <form method="post" class="rodauth" role="form" id="create-account-form">
2
2
  #{rodauth.create_account_additional_form_tags}
3
3
  #{rodauth.csrf_tag}
4
4
  #{rodauth.render('login-field')}
@@ -1,7 +1,6 @@
1
- <form action="#{rodauth.email_auth_request_path}" method="post" class="rodauth form-horizontal" role="form" id="email-auth-request-form">
1
+ <form action="#{rodauth.email_auth_request_path}" method="post" class="rodauth" role="form" id="email-auth-request-form">
2
2
  #{rodauth.email_auth_request_additional_form_tags}
3
3
  #{rodauth.csrf_tag(rodauth.email_auth_request_path)}
4
4
  #{rodauth.login_hidden_field}
5
5
  #{rodauth.button(rodauth.email_auth_request_button)}
6
6
  </form>
7
-
@@ -1,4 +1,4 @@
1
- <form method="post" class="rodauth form-horizontal" role="form" id="email-auth-form">
1
+ <form method="post" class="rodauth" role="form" id="email-auth-form">
2
2
  #{rodauth.email_auth_additional_form_tags}
3
3
  #{rodauth.csrf_tag}
4
4
  #{rodauth.button(rodauth.login_button)}
@@ -0,0 +1,6 @@
1
+ <div class="form-group">
2
+ <div class="form-check checkbox">
3
+ <input type="checkbox" name="#{rodauth.global_logout_param}" class="form-check-input" id="global-logout" value="t"/>
4
+ <label class="rodauth-global-logout-label form-check-label" for="global-logout">#{rodauth.global_logout_label}</label>
5
+ </div>
6
+ </div>
@@ -1,6 +1,4 @@
1
1
  <div class="form-group">
2
- <label class="col-sm-2 control-label" for="login-confirm">#{rodauth.login_confirm_label}#{rodauth.input_field_label_suffix}</label>
3
- <div class="col-sm-10">
4
- #{rodauth.input_field_string(rodauth.login_confirm_param, 'login-confirm', :type=>rodauth.login_input_type)}
5
- </div>
2
+ <label for="login-confirm">#{rodauth.login_confirm_label}#{rodauth.input_field_label_suffix}</label>
3
+ #{rodauth.input_field_string(rodauth.login_confirm_param, 'login-confirm', :type=>rodauth.login_input_type, :autocomplete=>rodauth.login_uses_email? ? "email" : "on")}
6
4
  </div>
@@ -1,4 +1,5 @@
1
1
  <div class="form-group">
2
- <label class="col-sm-2 control-label">#{rodauth.login_label}</label>
3
- <div class="col-sm-10">#{rodauth.login_hidden_field}#{h rodauth.param(rodauth.login_param)}</div>
2
+ #{rodauth.login_hidden_field}
3
+ <label for="login">#{rodauth.login_label}</label>
4
+ <div class="form-control-plaintext form-control-static">#{h rodauth.param(rodauth.login_param)}</div>
4
5
  </div>
@@ -1,6 +1,4 @@
1
1
  <div class="form-group">
2
- <label class="col-sm-2 control-label" for="login">#{rodauth.login_label}#{rodauth.input_field_label_suffix}</label>
3
- <div class="col-sm-10">
4
- #{rodauth.input_field_string(rodauth.login_param, 'login', :type=>rodauth.login_input_type)}
5
- </div>
2
+ <label for="login">#{rodauth.login_label}#{rodauth.input_field_label_suffix}</label>
3
+ #{rodauth.input_field_string(rodauth.login_param, 'login', :type=>rodauth.login_input_type, :autocomplete=>rodauth.login_uses_email? ? "email" : "on")}
6
4
  </div>
@@ -0,0 +1,6 @@
1
+ #{rodauth.login_form_footer_links_heading}
2
+ <ul class="rodauth-links rodauth-login-footer-links">
3
+ #{rodauth.login_form_footer_links.sort.map do |_, link, text|
4
+ "<li><a href=\"#{h link}\">#{h text}</a></li>"
5
+ end.join("\n")}
6
+ </ul>
@@ -0,0 +1,7 @@
1
+ <form method="post" class="rodauth" role="form" id="login-form">
2
+ #{rodauth.login_additional_form_tags}
3
+ #{rodauth.csrf_tag}
4
+ #{rodauth.skip_login_field_on_login? ? rodauth.render('login-display') : rodauth.render('login-field')}
5
+ #{rodauth.render('password-field') unless rodauth.skip_password_field_on_login?}
6
+ #{rodauth.button(rodauth.login_button)}
7
+ </form>
@@ -1,11 +1,3 @@
1
1
  #{rodauth.login_form_header}
2
-
3
- <form method="post" class="rodauth form-horizontal" role="form" id="login-form">
4
- #{rodauth.login_additional_form_tags}
5
- #{rodauth.csrf_tag}
6
- #{rodauth.skip_login_field_on_login? ? rodauth.render('login-display') : rodauth.render('login-field')}
7
- #{rodauth.render('password-field') unless rodauth.skip_password_field_on_login?}
8
- #{rodauth.button(rodauth.login_button)}
9
- </form>
10
-
2
+ #{rodauth.render('login-form')}
11
3
  #{rodauth.login_form_footer}
@@ -1,4 +1,4 @@
1
- <form method="post" class="rodauth form-horizontal" role="form" id="logout-form">
1
+ <form method="post" class="rodauth" role="form" id="logout-form">
2
2
  #{rodauth.logout_additional_form_tags}
3
3
  #{rodauth.csrf_tag}
4
4
  #{rodauth.button(rodauth.logout_button, :class=>'btn btn-warning')}
@@ -0,0 +1,3 @@
1
+ #{rodauth.login_form_header}
2
+ #{rodauth.render_multi_phase_login_forms}
3
+ #{rodauth.login_form_footer}
@@ -1,6 +1,8 @@
1
1
  <div class="form-group">
2
- <label class="col-sm-4 control-label" for="otp-auth-code">#{rodauth.otp_auth_label}#{rodauth.input_field_label_suffix}</label>
3
- <div class="col-sm-3">
4
- #{rodauth.input_field_string(rodauth.otp_auth_param, 'otp-auth-code', :value=>'', :attr=>'autocomplete="off"' )}
2
+ <label for="otp-auth-code">#{rodauth.otp_auth_label}#{rodauth.input_field_label_suffix}</label>
3
+ <div class="row">
4
+ <div class="col-sm-3">
5
+ #{rodauth.input_field_string(rodauth.otp_auth_param, 'otp-auth-code', :value=>'', :autocomplete=>"off", :inputmode=>'numeric')}
6
+ </div>
5
7
  </div>
6
8
  </div>
@@ -1,4 +1,4 @@
1
- <form method="post" class="rodauth form-horizontal" role="form" id="otp-auth-form">
1
+ <form method="post" class="rodauth" role="form" id="otp-auth-form">
2
2
  #{rodauth.otp_auth_additional_form_tags}
3
3
  #{rodauth.csrf_tag}
4
4
  #{rodauth.render('otp-auth-code-field')}
@@ -1,4 +1,4 @@
1
- <form method="post" class="rodauth form-horizontal" role="form" id="otp-disable-form">
1
+ <form method="post" class="rodauth" role="form" id="otp-disable-form">
2
2
  #{rodauth.otp_disable_additional_form_tags}
3
3
  #{rodauth.csrf_tag}
4
4
  #{rodauth.render('password-field') if rodauth.two_factor_modifications_require_password?}
@@ -1,4 +1,4 @@
1
- <form method="post" class="rodauth form-horizontal" role="form" id="otp-setup-form">
1
+ <form method="post" class="rodauth" role="form" id="otp-setup-form">
2
2
  #{rodauth.otp_setup_additional_form_tags}
3
3
  <input type="hidden" id="otp-key" name="#{rodauth.otp_setup_param}" value="#{rodauth.otp_user_key}" />
4
4
  #{"<input type=\"hidden\" id=\"otp-hmac-secret\" name=\"#{rodauth.otp_setup_raw_param}\" value=\"#{rodauth.otp_key}\" />" if rodauth.otp_keys_use_hmac?}
@@ -9,13 +9,13 @@
9
9
  </div>
10
10
 
11
11
  <div class="row">
12
- <div class="col-sm-6 col-sm">
12
+ <div class="col-lg-6 col-lg">
13
13
  <div class="form-group">
14
14
  <p>#{rodauth.otp_qr_code}</p>
15
15
  </div>
16
16
  </div>
17
17
 
18
- <div class="col-sm-6 col-sm">
18
+ <div class="col-lg-6 col-lg">
19
19
  #{rodauth.render('password-field') if rodauth.two_factor_modifications_require_password?}
20
20
  #{rodauth.render('otp-auth-code-field')}
21
21
  #{rodauth.button(rodauth.otp_setup_button)}
@@ -1,6 +1,4 @@
1
1
  <div class="form-group">
2
- <label class="col-sm-2 control-label" for="password-confirm">#{rodauth.password_confirm_label}#{rodauth.input_field_label_suffix}</label>
3
- <div class="col-sm-10">
4
- #{rodauth.input_field_string(rodauth.password_confirm_param, 'password-confirm', :type => 'password')}
5
- </div>
2
+ <label for="password-confirm">#{rodauth.password_confirm_label}#{rodauth.input_field_label_suffix}</label>
3
+ #{rodauth.input_field_string(rodauth.password_confirm_param, 'password-confirm', :type => 'password', :autocomplete=>'new-password')}
6
4
  </div>
@@ -1,6 +1,4 @@
1
1
  <div class="form-group">
2
- <label class="col-sm-2 control-label" for="password">#{rodauth.password_label}#{rodauth.input_field_label_suffix}</label>
3
- <div class="col-sm-10">
4
- #{rodauth.input_field_string(rodauth.password_param, 'password', :type => 'password')}
5
- </div>
2
+ <label for="password">#{rodauth.password_label}#{rodauth.input_field_label_suffix}</label>
3
+ #{rodauth.input_field_string(rodauth.password_param, 'password', :type => 'password', :autocomplete=>'current-password')}
6
4
  </div>
@@ -1,12 +1,9 @@
1
- <form method="post" class="rodauth form-horizontal" role="form" id="recovery-auth-form">
1
+ <form method="post" class="rodauth" role="form" id="recovery-auth-form">
2
2
  #{rodauth.recovery_auth_additional_form_tags}
3
3
  #{rodauth.csrf_tag}
4
4
  <div class="form-group">
5
- <label class="col-sm-2 control-label" for="recovery_code">#{rodauth.recovery_codes_label}#{rodauth.input_field_label_suffix}</label>
6
- <div class="col-sm-10">
7
- #{rodauth.input_field_string(rodauth.recovery_codes_param, 'recovery_code', :value => '')}
8
- </div>
5
+ <label for="recovery-code">#{rodauth.recovery_codes_label}#{rodauth.input_field_label_suffix}</label>
6
+ #{rodauth.input_field_string(rodauth.recovery_codes_param, 'recovery-code', :value => '', :autocomplete=>'off')}
9
7
  </div>
10
8
  #{rodauth.button(rodauth.recovery_auth_button)}
11
9
  </form>
12
-
@@ -1,4 +1,4 @@
1
- <form method="post" class="rodauth form-horizontal" role="form" id="recovery-codes-form">
1
+ <form method="post" class="rodauth" role="form" id="recovery-codes-form">
2
2
  #{rodauth.recovery_codes_additional_form_tags}
3
3
  #{rodauth.csrf_tag}
4
4
  #{rodauth.render('password-field') if rodauth.two_factor_modifications_require_password?}
@@ -1,24 +1,19 @@
1
- <form method="post" class="rodauth form-horizontal" role="form" id="remember-form">
1
+ <form method="post" class="rodauth" role="form" id="remember-form">
2
2
  #{rodauth.remember_additional_form_tags}
3
3
  #{rodauth.csrf_tag}
4
- <div class="radio">
5
- <label>
6
- <input type="radio" name="#{rodauth.remember_param}" id="remember_remember" value="#{rodauth.remember_remember_param_value}"/>
7
- #{rodauth.remember_remember_label}
8
- </label>
9
- </div>
10
- <div class="radio">
11
- <label>
12
- <input type="radio" name="#{rodauth.remember_param}" id="remember_forget" value="#{rodauth.remember_forget_param_value}"/>
13
- #{rodauth.remember_forget_label}
14
- </label>
15
- </div>
16
- <div class="radio">
17
- <label>
18
- <input type="radio" name="#{rodauth.remember_param}" id="remember_disable" value="#{rodauth.remember_disable_param_value}"/>
19
- #{rodauth.remember_disable_label}
20
- </label>
21
- </div>
4
+ <fieldset class="form-group">
5
+ <div class="form-check radio">
6
+ <input type="radio" name="#{rodauth.remember_param}" id="remember-remember" value="#{h rodauth.remember_remember_param_value}" class="form-check-input"/>
7
+ <label class="form-check-label" for="remember-remember">#{rodauth.remember_remember_label}</label>
8
+ </div>
9
+ <div class="form-check radio">
10
+ <input type="radio" name="#{rodauth.remember_param}" id="remember-forget" value="#{h rodauth.remember_forget_param_value}" class="form-check-input"/>
11
+ <label class="form-check-label" for="remember-forget">#{rodauth.remember_forget_label}</label>
12
+ </div>
13
+ <div class="form-check radio">
14
+ <input type="radio" name="#{rodauth.remember_param}" id="remember-disable" value="#{h rodauth.remember_disable_param_value}" class="form-check-input"/>
15
+ <label class="form-check-label" for="remember-disable">#{rodauth.remember_disable_label}</label>
16
+ </div>
17
+ </fieldset>
22
18
  #{rodauth.button(rodauth.remember_button)}
23
19
  </form>
24
-
@@ -1,7 +1,7 @@
1
- <form action="#{rodauth.reset_password_request_path}" method="post" class="rodauth form-horizontal" role="form" id="reset-password-request-form">
1
+ <form action="#{rodauth.reset_password_request_path}" method="post" class="rodauth" role="form" id="reset-password-request-form">
2
2
  #{rodauth.reset_password_request_additional_form_tags}
3
3
  #{rodauth.csrf_tag(rodauth.reset_password_request_path)}
4
4
  #{rodauth.reset_password_explanatory_text}
5
- #{rodauth.param_or_nil(rodauth.login_param) ? rodauth.login_hidden_field : rodauth.render('login-field')}
5
+ #{rodauth.param_or_nil(rodauth.login_param) && !rodauth.field_error(rodauth.login_param) ? rodauth.login_hidden_field : rodauth.render('login-field')}
6
6
  #{rodauth.button(rodauth.reset_password_request_button)}
7
7
  </form>
@@ -1,8 +1,7 @@
1
- <form method="post" class="rodauth form-horizontal" role="form" id="reset-password-form">
1
+ <form method="post" class="rodauth" role="form" id="reset-password-form">
2
2
  #{rodauth.reset_password_additional_form_tags}
3
3
  #{rodauth.csrf_tag}
4
4
  #{rodauth.render('password-field')}
5
5
  #{rodauth.render('password-confirm-field') if rodauth.require_password_confirmation?}
6
6
  #{rodauth.button(rodauth.reset_password_button)}
7
7
  </form>
8
-
@@ -1,4 +1,4 @@
1
- <form method="post" class="rodauth form-horizontal" role="form" id="sms-auth-form">
1
+ <form method="post" class="rodauth" role="form" id="sms-auth-form">
2
2
  #{rodauth.sms_auth_additional_form_tags}
3
3
  #{rodauth.csrf_tag}
4
4
  #{rodauth.render('sms-code-field')}