rodauth 0.10.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +146 -0
  3. data/README.rdoc +644 -220
  4. data/Rakefile +99 -11
  5. data/doc/account_expiration.rdoc +55 -0
  6. data/doc/base.rdoc +104 -0
  7. data/doc/change_login.rdoc +29 -0
  8. data/doc/change_password.rdoc +26 -0
  9. data/doc/close_account.rdoc +31 -0
  10. data/doc/confirm_password.rdoc +22 -0
  11. data/doc/create_account.rdoc +34 -0
  12. data/doc/disallow_password_reuse.rdoc +37 -0
  13. data/doc/email_base.rdoc +19 -0
  14. data/doc/jwt.rdoc +35 -0
  15. data/doc/lockout.rdoc +83 -0
  16. data/doc/login.rdoc +27 -0
  17. data/doc/login_password_requirements_base.rdoc +50 -0
  18. data/doc/logout.rdoc +21 -0
  19. data/doc/otp.rdoc +100 -0
  20. data/doc/password_complexity.rdoc +50 -0
  21. data/doc/password_expiration.rdoc +52 -0
  22. data/doc/password_grace_period.rdoc +10 -0
  23. data/doc/recovery_codes.rdoc +60 -0
  24. data/doc/release_notes/1.0.0.txt +443 -0
  25. data/doc/remember.rdoc +82 -0
  26. data/doc/reset_password.rdoc +70 -0
  27. data/doc/session_expiration.rdoc +27 -0
  28. data/doc/single_session.rdoc +43 -0
  29. data/doc/sms_codes.rdoc +119 -0
  30. data/doc/two_factor_base.rdoc +27 -0
  31. data/doc/verify_account.rdoc +70 -0
  32. data/doc/verify_account_grace_period.rdoc +15 -0
  33. data/doc/verify_change_login.rdoc +9 -0
  34. data/lib/roda/plugins/rodauth.rb +3 -262
  35. data/lib/rodauth.rb +260 -0
  36. data/lib/rodauth/features/account_expiration.rb +108 -0
  37. data/lib/rodauth/features/base.rb +479 -0
  38. data/lib/rodauth/features/change_login.rb +77 -0
  39. data/lib/rodauth/features/change_password.rb +66 -0
  40. data/lib/rodauth/features/close_account.rb +82 -0
  41. data/lib/rodauth/features/confirm_password.rb +51 -0
  42. data/lib/rodauth/features/create_account.rb +128 -0
  43. data/lib/rodauth/features/disallow_password_reuse.rb +82 -0
  44. data/lib/rodauth/features/email_base.rb +63 -0
  45. data/lib/rodauth/features/jwt.rb +151 -0
  46. data/lib/rodauth/features/lockout.rb +262 -0
  47. data/lib/rodauth/features/login.rb +61 -0
  48. data/lib/rodauth/features/login_password_requirements_base.rb +123 -0
  49. data/lib/rodauth/features/logout.rb +37 -0
  50. data/lib/rodauth/features/otp.rb +338 -0
  51. data/lib/rodauth/features/password_complexity.rb +89 -0
  52. data/lib/rodauth/features/password_expiration.rb +111 -0
  53. data/lib/rodauth/features/password_grace_period.rb +46 -0
  54. data/lib/rodauth/features/recovery_codes.rb +240 -0
  55. data/lib/rodauth/features/remember.rb +200 -0
  56. data/lib/rodauth/features/reset_password.rb +207 -0
  57. data/lib/rodauth/features/session_expiration.rb +55 -0
  58. data/lib/rodauth/features/single_session.rb +87 -0
  59. data/lib/rodauth/features/sms_codes.rb +498 -0
  60. data/lib/rodauth/features/two_factor_base.rb +135 -0
  61. data/lib/rodauth/features/verify_account.rb +232 -0
  62. data/lib/rodauth/features/verify_account_grace_period.rb +76 -0
  63. data/lib/rodauth/features/verify_change_login.rb +20 -0
  64. data/lib/rodauth/migrations.rb +130 -0
  65. data/lib/rodauth/version.rb +9 -0
  66. data/spec/account_expiration_spec.rb +90 -0
  67. data/spec/all.rb +1 -0
  68. data/spec/change_login_spec.rb +149 -0
  69. data/spec/change_password_spec.rb +177 -0
  70. data/spec/close_account_spec.rb +162 -0
  71. data/spec/confirm_password_spec.rb +70 -0
  72. data/spec/create_account_spec.rb +127 -0
  73. data/spec/disallow_password_reuse_spec.rb +84 -0
  74. data/spec/lockout_spec.rb +228 -0
  75. data/spec/login_spec.rb +188 -0
  76. data/spec/migrate/001_tables.rb +103 -16
  77. data/spec/migrate/002_account_password_hash_column.rb +11 -0
  78. data/spec/migrate_password/001_tables.rb +60 -42
  79. data/spec/migrate_travis/001_tables.rb +116 -0
  80. data/spec/password_complexity_spec.rb +108 -0
  81. data/spec/password_expiration_spec.rb +243 -0
  82. data/spec/password_grace_period_spec.rb +93 -0
  83. data/spec/remember_spec.rb +424 -0
  84. data/spec/reset_password_spec.rb +185 -0
  85. data/spec/rodauth_spec.rb +57 -980
  86. data/spec/session_expiration_spec.rb +58 -0
  87. data/spec/single_session_spec.rb +107 -0
  88. data/spec/spec_helper.rb +202 -0
  89. data/spec/two_factor_spec.rb +1310 -0
  90. data/spec/verify_account_grace_period_spec.rb +135 -0
  91. data/spec/verify_account_spec.rb +142 -0
  92. data/spec/verify_change_login_spec.rb +46 -0
  93. data/spec/views/login.str +2 -2
  94. data/templates/add-recovery-codes.str +2 -0
  95. data/templates/button.str +5 -0
  96. data/templates/change-login.str +5 -18
  97. data/templates/change-password.str +6 -14
  98. data/templates/close-account.str +3 -6
  99. data/templates/confirm-password.str +4 -14
  100. data/templates/create-account.str +6 -30
  101. data/templates/login-confirm-field.str +6 -0
  102. data/templates/login-field.str +6 -0
  103. data/templates/login.str +5 -19
  104. data/templates/logout.str +2 -6
  105. data/templates/otp-auth-code-field.str +6 -0
  106. data/templates/otp-auth.str +8 -0
  107. data/templates/otp-disable.str +6 -0
  108. data/templates/otp-setup.str +21 -0
  109. data/templates/password-confirm-field.str +6 -0
  110. data/templates/password-field.str +6 -0
  111. data/templates/recovery-auth.str +12 -0
  112. data/templates/recovery-codes.str +6 -0
  113. data/templates/remember.str +8 -12
  114. data/templates/reset-password-request.str +2 -2
  115. data/templates/reset-password.str +4 -18
  116. data/templates/sms-auth.str +6 -0
  117. data/templates/sms-code-field.str +6 -0
  118. data/templates/sms-confirm.str +7 -0
  119. data/templates/sms-disable.str +7 -0
  120. data/templates/sms-request.str +5 -0
  121. data/templates/sms-setup.str +12 -0
  122. data/templates/unlock-account-request.str +3 -7
  123. data/templates/unlock-account.str +4 -7
  124. data/templates/verify-account-resend.str +2 -2
  125. data/templates/verify-account.str +2 -6
  126. metadata +191 -29
  127. data/lib/roda/plugins/rodauth/base.rb +0 -428
  128. data/lib/roda/plugins/rodauth/change_login.rb +0 -48
  129. data/lib/roda/plugins/rodauth/change_password.rb +0 -42
  130. data/lib/roda/plugins/rodauth/close_account.rb +0 -42
  131. data/lib/roda/plugins/rodauth/create_account.rb +0 -92
  132. data/lib/roda/plugins/rodauth/lockout.rb +0 -292
  133. data/lib/roda/plugins/rodauth/login.rb +0 -81
  134. data/lib/roda/plugins/rodauth/logout.rb +0 -36
  135. data/lib/roda/plugins/rodauth/remember.rb +0 -226
  136. data/lib/roda/plugins/rodauth/reset_password.rb +0 -205
  137. data/lib/roda/plugins/rodauth/verify_account.rb +0 -228
@@ -0,0 +1,6 @@
1
+ <div class="form-group">
2
+ <label class="col-sm-2 control-label" for="login-confirm">#{rodauth.login_confirm_label}</label>
3
+ <div class="col-sm-10">
4
+ <input type="text" class="form-control" name="login-confirm" id="#{rodauth.login_confirm_param}" value="#{h request[rodauth.login_confirm_param]}"/>
5
+ </div>
6
+ </div>
@@ -0,0 +1,6 @@
1
+ <div class="form-group">
2
+ <label class="col-sm-2 control-label" for="login">#{rodauth.login_label}</label>
3
+ <div class="col-sm-10">
4
+ <input type="text" class="form-control#{' error' if rodauth.field_error(rodauth.login_param)}" name="#{rodauth.login_param}" id="login" value="#{h request[rodauth.login_param]}"/> #{rodauth.field_error(rodauth.login_param)}
5
+ </div>
6
+ </div>
@@ -1,25 +1,11 @@
1
- #{@login_form_header}
1
+ #{rodauth.login_form_header}
2
2
 
3
3
  <form method="post" class="rodauth form-horizontal" role="form" id="login-form">
4
4
  #{rodauth.login_additional_form_tags}
5
- #{csrf_tag if respond_to?(:csrf_tag)}
6
- <div class="form-group">
7
- <label class="col-sm-2 control-label" for="login">#{rodauth.login_label}</label>
8
- <div class="col-sm-10">
9
- <input type="text" class="form-control#{' error' if @login_error}" name="#{rodauth.login_param}" id="login" value="#{h request[rodauth.login_param]}"/> #{@login_error}
10
- </div>
11
- </div>
12
- <div class="form-group">
13
- <label class="col-sm-2 control-label" for="password">#{rodauth.password_label}</label>
14
- <div class="col-sm-10">
15
- <input type="password" class="form-control#{' error' if @password_error}" name="#{rodauth.password_param}" id="password"/> #{@password_error}
16
- </div>
17
- </div>
18
- <div class="form-group">
19
- <div class="col-sm-offset-2 col-sm-10">
20
- <input type="submit" class="btn btn-primary" value="#{rodauth.login_button}"/>
21
- </div>
22
- </div>
5
+ #{rodauth.csrf_tag}
6
+ #{rodauth.render('login-field')}
7
+ #{rodauth.render('password-field')}
8
+ #{rodauth.button(rodauth.login_button)}
23
9
  </form>
24
10
 
25
11
  #{rodauth.login_form_footer}
@@ -1,9 +1,5 @@
1
1
  <form method="post" class="rodauth form-horizontal" role="form" id="logout-form">
2
2
  #{rodauth.logout_additional_form_tags}
3
- #{csrf_tag if respond_to?(:csrf_tag)}
4
- <div class="form-group">
5
- <div class="col-sm-offset-2 col-sm-10">
6
- <input type="submit" class="btn btn-warning" value="#{rodauth.logout_button}"/>
7
- </div>
8
- </div>
3
+ #{rodauth.csrf_tag}
4
+ #{rodauth.button(rodauth.logout_button, :class=>'btn btn-warning')}
9
5
  </form>
@@ -0,0 +1,6 @@
1
+ <div class="form-group">
2
+ <label class="col-sm-4 control-label" for="otp-auth-code">#{rodauth.otp_auth_label}</label>
3
+ <div class="col-sm-3">
4
+ <input type="text" class="form-control#{' error' if rodauth.field_error(rodauth.otp_auth_param)}" name="#{rodauth.otp_auth_param}" id="otp-auth-code" value=""/> #{rodauth.field_error(rodauth.otp_auth_param)}
5
+ </div>
6
+ </div>
@@ -0,0 +1,8 @@
1
+ <form method="post" class="rodauth form-horizontal" role="form" id="otp-auth-form">
2
+ #{rodauth.otp_auth_additional_form_tags}
3
+ #{rodauth.csrf_tag}
4
+ #{rodauth.render('otp-auth-code-field')}
5
+ #{rodauth.button(rodauth.otp_auth_button)}
6
+ </form>
7
+
8
+ #{rodauth.otp_auth_form_footer}
@@ -0,0 +1,6 @@
1
+ <form method="post" class="rodauth form-horizontal" role="form" id="otp-disable-form">
2
+ #{rodauth.otp_disable_additional_form_tags}
3
+ #{rodauth.csrf_tag}
4
+ #{rodauth.render('password-field') if rodauth.two_factor_modifications_require_password?}
5
+ #{rodauth.button(rodauth.otp_disable_button, :class=>'btn btn-warning')}
6
+ </form>
@@ -0,0 +1,21 @@
1
+ <form method="post" class="rodauth form-horizontal" role="form" id="otp-setup-form">
2
+ #{rodauth.otp_setup_additional_form_tags}
3
+ <input type="hidden" id="otp-key" name="#{rodauth.otp_setup_param}" value="#{rodauth.otp_key}" />
4
+ #{rodauth.csrf_tag}
5
+
6
+ <div class="col-sm-6">
7
+ <div class="form-group">
8
+ <p>Secret: #{rodauth.otp_key}</p>
9
+ <p>Provisioning URL: #{rodauth.otp_provisioning_uri}</p>
10
+ </div>
11
+ #{rodauth.render('password-field') if rodauth.two_factor_modifications_require_password?}
12
+ #{rodauth.render('otp-auth-code-field')}
13
+ #{rodauth.button(rodauth.otp_setup_button)}
14
+ </div>
15
+
16
+ <div class="col-sm-6">
17
+ <div class="form-group">
18
+ <p>#{rodauth.otp_qr_code}</p>
19
+ </div>
20
+ </div>
21
+ </form>
@@ -0,0 +1,6 @@
1
+ <div class="form-group">
2
+ <label class="col-sm-2 control-label" for="password-confirm">#{rodauth.password_confirm_label}</label>
3
+ <div class="col-sm-10">
4
+ <input type="password" class="form-control" name="#{rodauth.password_confirm_param}" id="password-confirm"/>
5
+ </div>
6
+ </div>
@@ -0,0 +1,6 @@
1
+ <div class="form-group">
2
+ <label class="col-sm-2 control-label" for="password">#{rodauth.password_label}</label>
3
+ <div class="col-sm-10">
4
+ <input type="password" class="form-control#{' error' if rodauth.field_error(rodauth.password_param)}" name="#{rodauth.password_param}" id="password"/> #{rodauth.field_error(rodauth.password_param)}
5
+ </div>
6
+ </div>
@@ -0,0 +1,12 @@
1
+ <form method="post" class="rodauth form-horizontal" role="form" id="recovery-auth-form">
2
+ #{rodauth.recovery_auth_additional_form_tags}
3
+ #{rodauth.csrf_tag}
4
+ <div class="form-group">
5
+ <label class="col-sm-2 control-label" for="recovery_code">#{rodauth.recovery_codes_label}</label>
6
+ <div class="col-sm-10">
7
+ <input type="text" class="form-control#{' error' if rodauth.field_error(rodauth.recovery_codes_param)}" name="#{rodauth.recovery_codes_param}" id="recovery_code" value=""/> #{rodauth.field_error(rodauth.recovery_codes_param)}
8
+ </div>
9
+ </div>
10
+ #{rodauth.button(rodauth.recovery_auth_button)}
11
+ </form>
12
+
@@ -0,0 +1,6 @@
1
+ <form method="post" class="rodauth form-horizontal" role="form" id="recovery-codes-form">
2
+ #{rodauth.recovery_codes_additional_form_tags}
3
+ #{rodauth.csrf_tag}
4
+ #{rodauth.render('password-field') if rodauth.two_factor_modifications_require_password?}
5
+ #{rodauth.button(rodauth.recovery_codes_button || rodauth.view_recovery_codes_button, :name=>(rodauth.add_recovery_codes_param if rodauth.recovery_codes_button))}
6
+ </form>
@@ -1,28 +1,24 @@
1
1
  <form method="post" class="rodauth form-horizontal" role="form" id="remember-form">
2
2
  #{rodauth.remember_additional_form_tags}
3
- #{csrf_tag if respond_to?(:csrf_tag)}
3
+ #{rodauth.csrf_tag}
4
4
  <div class="radio">
5
5
  <label>
6
- <input type="radio" name="remember" id="remember_remember" value="remember"/>
7
- Remember Me
6
+ <input type="radio" name="#{rodauth.remember_param}" id="remember_remember" value="#{rodauth.remember_remember_param_value}"/>
7
+ #{rodauth.remember_remember_label}
8
8
  </label>
9
9
  </div>
10
10
  <div class="radio">
11
11
  <label>
12
- <input type="radio" name="remember" id="remember_forget" value="forget"/>
13
- Forget Me
12
+ <input type="radio" name="#{rodauth.remember_param}" id="remember_forget" value="#{rodauth.remember_forget_param_value}"/>
13
+ #{rodauth.remember_forget_label}
14
14
  </label>
15
15
  </div>
16
16
  <div class="radio">
17
17
  <label>
18
- <input type="radio" name="remember" id="remember_disable" value="disable"/>
19
- Disable Remember Me
18
+ <input type="radio" name="#{rodauth.remember_param}" id="remember_disable" value="#{rodauth.remember_disable_param_value}"/>
19
+ #{rodauth.remember_disable_label}
20
20
  </label>
21
21
  </div>
22
- <div class="form-group">
23
- <div class="col-sm-offset-2 col-sm-10">
24
- <input type="submit" class="btn btn-primary" value="#{rodauth.remember_button}"/>
25
- </div>
26
- </div>
22
+ #{rodauth.button(rodauth.remember_button)}
27
23
  </form>
28
24
 
@@ -1,7 +1,7 @@
1
- <form action="#{rodauth.prefix}/#{rodauth.reset_password_route}" method="post" class="rodauth form-horizontal" role="form" id="reset-password-request-form">
1
+ <form action="#{rodauth.prefix}/#{rodauth.reset_password_request_route}" method="post" class="rodauth form-horizontal" role="form" id="reset-password-request-form">
2
2
  #{rodauth.reset_password_request_additional_form_tags}
3
3
  <input type="hidden" name="#{rodauth.login_param}" value="#{h request[rodauth.login_param]}"/>
4
- #{csrf_tag if respond_to?(:csrf_tag)}
4
+ #{rodauth.csrf_tag}
5
5
  If you have forgotten your password, you can request a password reset:
6
6
  <input type="submit" class="btn btn-primary inline" value="#{rodauth.reset_password_request_button}"/>
7
7
  </form>
@@ -1,23 +1,9 @@
1
1
  <form method="post" class="rodauth form-horizontal" role="form" id="reset-password-form">
2
2
  #{rodauth.reset_password_additional_form_tags}
3
3
  <input type="hidden" name="#{rodauth.reset_password_key_param}" value="#{h request[rodauth.reset_password_key_param]}" />
4
- #{csrf_tag if respond_to?(:csrf_tag)}
5
- <div class="form-group">
6
- <label class="col-sm-2 control-label" for="password">#{rodauth.password_label}</label>
7
- <div class="col-sm-10">
8
- <input type="password" class="form-control#{' error' if @password_error}" name="#{rodauth.password_param}" id="password"/> #{@password_error}
9
- </div>
10
- </div>
11
- <div class="form-group">
12
- <label class="col-sm-2 control-label" for="password-confirm">#{rodauth.password_confirm_label}</label>
13
- <div class="col-sm-10">
14
- <input type="password" class="form-control" name="#{rodauth.password_confirm_param}" id="password-confirm"/>
15
- </div>
16
- </div>
17
- <div class="form-group">
18
- <div class="col-sm-offset-2 col-sm-10">
19
- <input type="submit" class="btn btn-primary" value="#{rodauth.reset_password_button}"/>
20
- </div>
21
- </div>
4
+ #{rodauth.csrf_tag}
5
+ #{rodauth.render('password-field')}
6
+ #{rodauth.render('password-confirm-field') if rodauth.require_password_confirmation?}
7
+ #{rodauth.button(rodauth.reset_password_button)}
22
8
  </form>
23
9
 
@@ -0,0 +1,6 @@
1
+ <form method="post" class="rodauth form-horizontal" role="form" id="sms-auth-form">
2
+ #{rodauth.sms_auth_additional_form_tags}
3
+ #{rodauth.csrf_tag}
4
+ #{rodauth.render('sms-code-field')}
5
+ #{rodauth.button(rodauth.sms_auth_button)}
6
+ </form>
@@ -0,0 +1,6 @@
1
+ <div class="form-group">
2
+ <label class="col-sm-3 control-label" for="sms-code">#{rodauth.sms_code_label}</label>
3
+ <div class="col-sm-3">
4
+ <input type="text" class="form-control#{' error' if rodauth.field_error(rodauth.sms_code_param)}" name="#{rodauth.sms_code_param}" id="sms-code" value=""/> #{rodauth.field_error(rodauth.sms_code_param)}
5
+ </div>
6
+ </div>
@@ -0,0 +1,7 @@
1
+ <form method="post" class="rodauth form-horizontal" role="form" id="sms-confirm-form">
2
+ #{rodauth.sms_confirm_additional_form_tags}
3
+ #{rodauth.csrf_tag}
4
+ #{rodauth.render('sms-code-field')}
5
+ #{rodauth.button(rodauth.sms_confirm_button)}
6
+ </form>
7
+
@@ -0,0 +1,7 @@
1
+ <form method="post" class="rodauth form-horizontal" role="form" id="sms-disable-form">
2
+ #{rodauth.sms_disable_additional_form_tags}
3
+ #{rodauth.csrf_tag}
4
+ #{rodauth.render('password-field') if rodauth.two_factor_modifications_require_password?}
5
+ #{rodauth.button(rodauth.sms_disable_button)}
6
+ </form>
7
+
@@ -0,0 +1,5 @@
1
+ <form method="post" class="rodauth form-horizontal" role="form" id="sms-request-form">
2
+ #{rodauth.sms_request_additional_form_tags}
3
+ #{rodauth.csrf_tag}
4
+ #{rodauth.button(rodauth.sms_request_button)}
5
+ </form>
@@ -0,0 +1,12 @@
1
+ <form method="post" class="rodauth form-horizontal" role="form" id="sms-setup-form">
2
+ #{rodauth.sms_setup_additional_form_tags}
3
+ #{rodauth.csrf_tag}
4
+ #{rodauth.render('password-field') if rodauth.two_factor_modifications_require_password?}
5
+ <div class="form-group">
6
+ <label class="col-sm-2 control-label" for="sms-phone">#{rodauth.sms_phone_label}</label>
7
+ <div class="col-sm-3">
8
+ <input type="text" class="form-control#{' error' if rodauth.field_error(rodauth.sms_phone_param)}" name="#{rodauth.sms_phone_param}" id="sms-phone" value="#{h request[rodauth.sms_phone_param]}"/> #{rodauth.field_error(rodauth.sms_phone_param)}
9
+ </div>
10
+ </div>
11
+ #{rodauth.button(rodauth.sms_setup_button)}
12
+ </form>
@@ -1,11 +1,7 @@
1
- <form action="#{rodauth.prefix}/#{rodauth.unlock_account_route}" method="post" class="rodauth form-horizontal" role="form" id="unlock-account-request-form">
1
+ <form action="#{rodauth.prefix}/#{rodauth.unlock_account_request_route}" method="post" class="rodauth form-horizontal" role="form" id="unlock-account-request-form">
2
2
  #{rodauth.unlock_account_request_additional_form_tags}
3
- #{csrf_tag if respond_to?(:csrf_tag)}
3
+ #{rodauth.csrf_tag}
4
4
  <input type="hidden" name="#{rodauth.login_param}" value="#{h request[rodauth.login_param]}"/>
5
5
  This account is currently locked out. You can request that the account be unlocked:
6
- <div class="form-group">
7
- <div class="col-sm-offset-2 col-sm-10">
8
- <input type="submit" class="btn btn-warning" value="#{rodauth.unlock_account_request_button}"/>
9
- </div>
10
- </div>
6
+ <input type="submit" class="btn btn-primary inline" value="#{rodauth.unlock_account_request_button}"/>
11
7
  </form>
@@ -1,11 +1,8 @@
1
1
  <form method="post" class="rodauth form-horizontal" role="form" id="unlock-account-form">
2
2
  #{rodauth.unlock_account_additional_form_tags}
3
- #{csrf_tag if respond_to?(:csrf_tag)}
3
+ #{rodauth.csrf_tag}
4
4
  <input type="hidden" name="#{rodauth.unlock_account_key_param}" value="#{h request[rodauth.unlock_account_key_param]}"/>
5
- This account is currently locked out. You can unlock the account:
6
- <div class="form-group">
7
- <div class="col-sm-offset-2 col-sm-10">
8
- <input type="submit" class="btn btn-warning" value="#{rodauth.unlock_account_button}"/>
9
- </div>
10
- </div>
5
+ <p>This account is currently locked out. You can unlock the account.</p>
6
+ #{rodauth.render('password-field') if rodauth.unlock_account_requires_password?}
7
+ #{rodauth.button(rodauth.unlock_account_button)}
11
8
  </form>
@@ -1,7 +1,7 @@
1
- <form action="#{rodauth.prefix}/#{rodauth.verify_account_route}" method="post" class="rodauth form-horizontal" role="form" id="verify-account-resend-form">
1
+ <form action="#{rodauth.prefix}/#{rodauth.verify_account_resend_route}" method="post" class="rodauth form-horizontal" role="form" id="verify-account-resend-form">
2
2
  #{rodauth.verify_account_resend_additional_form_tags}
3
3
  <input type="hidden" name="#{rodauth.login_param}" value="#{h request[rodauth.login_param]}"/>
4
- #{csrf_tag if respond_to?(:csrf_tag)}
4
+ #{rodauth.csrf_tag}
5
5
  If you no longer have the email to verify the account, you can request that it be resent to you:
6
6
  <input type="submit" class="btn btn-primary inline" value="#{rodauth.verify_account_resend_button}"/>
7
7
  </form>
@@ -1,11 +1,7 @@
1
1
  <form method="post" class="rodauth form-horizontal" role="form" id="verify-account-form">
2
2
  #{rodauth.verify_account_additional_form_tags}
3
3
  <input type="hidden" name="#{rodauth.verify_account_key_param}" value="#{h request[rodauth.verify_account_key_param]}" />
4
- #{csrf_tag if respond_to?(:csrf_tag)}
5
- <div class="form-group">
6
- <div class="col-sm-offset-2 col-sm-10">
7
- <input type="submit" class="btn btn-warning" value="#{rodauth.verify_account_button}"/>
8
- </div>
9
- </div>
4
+ #{rodauth.csrf_tag}
5
+ #{rodauth.button(rodauth.verify_account_button)}
10
6
  </form>
11
7
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rodauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-17 00:00:00.000000000 Z
11
+ date: 2016-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '2'
33
+ version: 2.6.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '2'
40
+ version: 2.6.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: tilt
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -45,7 +45,7 @@ dependencies:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
- type: :runtime
48
+ type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
@@ -59,7 +59,7 @@ dependencies:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
- type: :runtime
62
+ type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
@@ -73,7 +73,7 @@ dependencies:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
- type: :runtime
76
+ type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
@@ -87,7 +87,49 @@ dependencies:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
- type: :runtime
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rotp
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rqrcode
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: jwt
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
91
133
  prerelease: false
92
134
  version_requirements: !ruby/object:Gem::Requirement
93
135
  requirements:
@@ -137,16 +179,16 @@ dependencies:
137
179
  - !ruby/object:Gem::Version
138
180
  version: 2.1.0
139
181
  description: |
140
- Rodauth is an authentication framework using Roda, Sequel, and PostgreSQL.
141
- It aims to provide strong security for password storage by utilizing
142
- separate PostgreSQL database accounts. Configuration is done via
182
+ Rodauth is an authentication and account management framework for
183
+ rack applications. It's built using Roda and Sequel, but it can
184
+ be used as middleware in front of web applications that use
185
+ other web frameworks and database libraries.
186
+
187
+ Rodauth aims to provide strong security for password storage by
188
+ utilizing separate database accounts if possible on PostgreSQL,
189
+ MySQL, and Microsoft SQL Server. Configuration is done via
143
190
  a DSL that makes it easy to override any part of the authentication
144
191
  process.
145
-
146
- Rodauth currently supports the following authentication-related
147
- features: login, logout, change password, change login, reset
148
- password, create account, close account, verify account, remember,
149
- and lockout.
150
192
  email: code@jeremyevans.net
151
193
  executables: []
152
194
  extensions: []
@@ -154,39 +196,159 @@ extra_rdoc_files:
154
196
  - README.rdoc
155
197
  - CHANGELOG
156
198
  - MIT-LICENSE
199
+ - doc/base.rdoc
200
+ - doc/login.rdoc
201
+ - doc/logout.rdoc
202
+ - doc/change_password.rdoc
203
+ - doc/reset_password.rdoc
204
+ - doc/remember.rdoc
205
+ - doc/create_account.rdoc
206
+ - doc/close_account.rdoc
207
+ - doc/verify_account.rdoc
208
+ - doc/lockout.rdoc
209
+ - doc/otp.rdoc
210
+ - doc/change_login.rdoc
211
+ - doc/password_complexity.rdoc
212
+ - doc/disallow_password_reuse.rdoc
213
+ - doc/password_expiration.rdoc
214
+ - doc/account_expiration.rdoc
215
+ - doc/single_session.rdoc
216
+ - doc/recovery_codes.rdoc
217
+ - doc/sms_codes.rdoc
218
+ - doc/email_base.rdoc
219
+ - doc/two_factor_base.rdoc
220
+ - doc/jwt.rdoc
221
+ - doc/password_grace_period.rdoc
222
+ - doc/session_expiration.rdoc
223
+ - doc/login_password_requirements_base.rdoc
224
+ - doc/verify_account_grace_period.rdoc
225
+ - doc/confirm_password.rdoc
226
+ - doc/verify_change_login.rdoc
227
+ - doc/release_notes/1.0.0.txt
157
228
  files:
158
229
  - CHANGELOG
159
230
  - MIT-LICENSE
160
231
  - README.rdoc
161
232
  - Rakefile
233
+ - doc/account_expiration.rdoc
234
+ - doc/base.rdoc
235
+ - doc/change_login.rdoc
236
+ - doc/change_password.rdoc
237
+ - doc/close_account.rdoc
238
+ - doc/confirm_password.rdoc
239
+ - doc/create_account.rdoc
240
+ - doc/disallow_password_reuse.rdoc
241
+ - doc/email_base.rdoc
242
+ - doc/jwt.rdoc
243
+ - doc/lockout.rdoc
244
+ - doc/login.rdoc
245
+ - doc/login_password_requirements_base.rdoc
246
+ - doc/logout.rdoc
247
+ - doc/otp.rdoc
248
+ - doc/password_complexity.rdoc
249
+ - doc/password_expiration.rdoc
250
+ - doc/password_grace_period.rdoc
251
+ - doc/recovery_codes.rdoc
252
+ - doc/release_notes/1.0.0.txt
253
+ - doc/remember.rdoc
254
+ - doc/reset_password.rdoc
255
+ - doc/session_expiration.rdoc
256
+ - doc/single_session.rdoc
257
+ - doc/sms_codes.rdoc
258
+ - doc/two_factor_base.rdoc
259
+ - doc/verify_account.rdoc
260
+ - doc/verify_account_grace_period.rdoc
261
+ - doc/verify_change_login.rdoc
162
262
  - lib/roda/plugins/rodauth.rb
163
- - lib/roda/plugins/rodauth/base.rb
164
- - lib/roda/plugins/rodauth/change_login.rb
165
- - lib/roda/plugins/rodauth/change_password.rb
166
- - lib/roda/plugins/rodauth/close_account.rb
167
- - lib/roda/plugins/rodauth/create_account.rb
168
- - lib/roda/plugins/rodauth/lockout.rb
169
- - lib/roda/plugins/rodauth/login.rb
170
- - lib/roda/plugins/rodauth/logout.rb
171
- - lib/roda/plugins/rodauth/remember.rb
172
- - lib/roda/plugins/rodauth/reset_password.rb
173
- - lib/roda/plugins/rodauth/verify_account.rb
263
+ - lib/rodauth.rb
264
+ - lib/rodauth/features/account_expiration.rb
265
+ - lib/rodauth/features/base.rb
266
+ - lib/rodauth/features/change_login.rb
267
+ - lib/rodauth/features/change_password.rb
268
+ - lib/rodauth/features/close_account.rb
269
+ - lib/rodauth/features/confirm_password.rb
270
+ - lib/rodauth/features/create_account.rb
271
+ - lib/rodauth/features/disallow_password_reuse.rb
272
+ - lib/rodauth/features/email_base.rb
273
+ - lib/rodauth/features/jwt.rb
274
+ - lib/rodauth/features/lockout.rb
275
+ - lib/rodauth/features/login.rb
276
+ - lib/rodauth/features/login_password_requirements_base.rb
277
+ - lib/rodauth/features/logout.rb
278
+ - lib/rodauth/features/otp.rb
279
+ - lib/rodauth/features/password_complexity.rb
280
+ - lib/rodauth/features/password_expiration.rb
281
+ - lib/rodauth/features/password_grace_period.rb
282
+ - lib/rodauth/features/recovery_codes.rb
283
+ - lib/rodauth/features/remember.rb
284
+ - lib/rodauth/features/reset_password.rb
285
+ - lib/rodauth/features/session_expiration.rb
286
+ - lib/rodauth/features/single_session.rb
287
+ - lib/rodauth/features/sms_codes.rb
288
+ - lib/rodauth/features/two_factor_base.rb
289
+ - lib/rodauth/features/verify_account.rb
290
+ - lib/rodauth/features/verify_account_grace_period.rb
291
+ - lib/rodauth/features/verify_change_login.rb
292
+ - lib/rodauth/migrations.rb
293
+ - lib/rodauth/version.rb
294
+ - spec/account_expiration_spec.rb
295
+ - spec/all.rb
296
+ - spec/change_login_spec.rb
297
+ - spec/change_password_spec.rb
298
+ - spec/close_account_spec.rb
299
+ - spec/confirm_password_spec.rb
300
+ - spec/create_account_spec.rb
301
+ - spec/disallow_password_reuse_spec.rb
302
+ - spec/lockout_spec.rb
303
+ - spec/login_spec.rb
174
304
  - spec/migrate/001_tables.rb
305
+ - spec/migrate/002_account_password_hash_column.rb
175
306
  - spec/migrate_password/001_tables.rb
307
+ - spec/migrate_travis/001_tables.rb
308
+ - spec/password_complexity_spec.rb
309
+ - spec/password_expiration_spec.rb
310
+ - spec/password_grace_period_spec.rb
311
+ - spec/remember_spec.rb
312
+ - spec/reset_password_spec.rb
176
313
  - spec/rodauth_spec.rb
314
+ - spec/session_expiration_spec.rb
315
+ - spec/single_session_spec.rb
316
+ - spec/spec_helper.rb
317
+ - spec/two_factor_spec.rb
318
+ - spec/verify_account_grace_period_spec.rb
319
+ - spec/verify_account_spec.rb
320
+ - spec/verify_change_login_spec.rb
177
321
  - spec/views/layout.str
178
322
  - spec/views/login.str
323
+ - templates/add-recovery-codes.str
324
+ - templates/button.str
179
325
  - templates/change-login.str
180
326
  - templates/change-password.str
181
327
  - templates/close-account.str
182
328
  - templates/confirm-password.str
183
329
  - templates/create-account.str
330
+ - templates/login-confirm-field.str
331
+ - templates/login-field.str
184
332
  - templates/login.str
185
333
  - templates/logout.str
334
+ - templates/otp-auth-code-field.str
335
+ - templates/otp-auth.str
336
+ - templates/otp-disable.str
337
+ - templates/otp-setup.str
338
+ - templates/password-confirm-field.str
339
+ - templates/password-field.str
340
+ - templates/recovery-auth.str
341
+ - templates/recovery-codes.str
186
342
  - templates/remember.str
187
343
  - templates/reset-password-email.str
188
344
  - templates/reset-password-request.str
189
345
  - templates/reset-password.str
346
+ - templates/sms-auth.str
347
+ - templates/sms-code-field.str
348
+ - templates/sms-confirm.str
349
+ - templates/sms-disable.str
350
+ - templates/sms-request.str
351
+ - templates/sms-setup.str
190
352
  - templates/unlock-account-email.str
191
353
  - templates/unlock-account-request.str
192
354
  - templates/unlock-account.str
@@ -203,7 +365,7 @@ rdoc_options:
203
365
  - "--line-numbers"
204
366
  - "--inline-source"
205
367
  - "--title"
206
- - 'Rodauth: Authentication Framework for Roda/Sequel/PostgreSQL'
368
+ - 'Rodauth: Authentication and Account Management Framework for Rack Applications'
207
369
  - "--main"
208
370
  - README.rdoc
209
371
  require_paths:
@@ -223,5 +385,5 @@ rubyforge_project:
223
385
  rubygems_version: 2.5.1
224
386
  signing_key:
225
387
  specification_version: 4
226
- summary: Authentication Framework for Roda/Sequel/PostgreSQL
388
+ summary: Authentication and Account Management Framework for Rack Applications
227
389
  test_files: []