rodauth-rails 1.6.4 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +24 -9
- data/lib/generators/rodauth/templates/INSTRUCTIONS +4 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/_email_auth_request_form.html.erb +5 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/_login_form.html.erb +24 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/_login_form_footer.html.erb +7 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/_login_form_header.html.erb +3 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/add_recovery_codes.html.erb +16 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/change_login.html.erb +25 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/change_password.html.erb +25 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/close_account.html.erb +11 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/confirm_password.html.erb +19 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/create_account.html.erb +33 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/email_auth.html.erb +3 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/login.html.erb +5 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/logout.html.erb +10 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/multi_phase_login.html.erb +5 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/otp_auth.html.erb +9 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/otp_disable.html.erb +11 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/otp_setup.html.erb +32 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/recovery_auth.html.erb +9 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/recovery_codes.html.erb +11 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/remember.html.erb +18 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/reset_password.html.erb +17 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/reset_password_request.html.erb +17 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/sms_auth.html.erb +9 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/sms_confirm.html.erb +9 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/sms_disable.html.erb +11 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/sms_request.html.erb +3 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/sms_setup.html.erb +17 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/two_factor_auth.html.erb +5 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/two_factor_disable.html.erb +11 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/two_factor_manage.html.erb +26 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/unlock_account.html.erb +15 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/unlock_account_request.html.erb +9 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/verify_account.html.erb +19 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/verify_account_resend.html.erb +17 -0
- data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/verify_login_change.html.erb +3 -0
- data/lib/generators/rodauth/views_generator.rb +18 -1
- data/lib/rodauth/rails/version.rb +1 -1
- metadata +37 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09013a1bf694e549fa97b25df4490342da804f04a4b390e3c443130b2ae6d39c'
|
4
|
+
data.tar.gz: 9c8a721619b16280d7892fe35ec6d0368d3bef2dd9eb0a26edddd5f65f87f5cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3710f7d71bff102f6a4564542575a75798df2063df3217a01574b04a541def22fb1ca04cf529fdfb1709e5f6c334f3ddda7027dce639f7b1d47ba4f71ba421df
|
7
|
+
data.tar.gz: b36c22fdd2e297058ac576d5c064ccb3a982370c0d0d70d2651a1b271ec2e0be4af7a8844dec098bfb839de90d5f3149d88987ed58c1728a4a7ecb039e874a4e
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -22,6 +22,8 @@ Provides Rails integration for the [Rodauth] authentication framework.
|
|
22
22
|
* [Rails Authentication with Rodauth](https://janko.io/adding-authentication-in-rails-with-rodauth/)
|
23
23
|
* [Multifactor Authentication in Rails with Rodauth](https://janko.io/adding-multifactor-authentication-in-rails-with-rodauth/)
|
24
24
|
* [How to build an OIDC provider using rodauth-oauth on Rails](https://honeyryderchuck.gitlab.io/httpx/2021/03/15/oidc-provider-on-rails-using-rodauth-oauth.html)
|
25
|
+
* [What It Took to Build a Rails Integration for Rodauth](https://janko.io/what-it-took-to-build-a-rails-integration-for-rodauth/)
|
26
|
+
* [Social Login in Rails with Rodauth](https://janko.io/social-login-in-rails-with-rodauth/)
|
25
27
|
|
26
28
|
## Why Rodauth?
|
27
29
|
|
@@ -93,18 +95,27 @@ default URL options in each environment. Here is a possible configuration for
|
|
93
95
|
`config/environments/development.rb`:
|
94
96
|
|
95
97
|
```rb
|
96
|
-
config.action_mailer.default_url_options = { host:
|
98
|
+
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
|
97
99
|
```
|
98
100
|
|
99
101
|
## Usage
|
100
102
|
|
101
|
-
|
103
|
+
The Rodauth app will be called for each request before it reaches the Rails
|
104
|
+
router. It handles requests to Rodauth endpoints, and allows you to call
|
105
|
+
additional code before your main routes.
|
106
|
+
|
107
|
+
```sh
|
108
|
+
$ rails middleware
|
109
|
+
# ...
|
110
|
+
# use Rodauth::Rails::Middleware (calls your Rodauth app)
|
111
|
+
# run YourApp::Application.routes
|
112
|
+
```
|
102
113
|
|
103
|
-
|
104
|
-
a Rails controller), Rodauth routes will not show in `rails routes`.
|
114
|
+
### Routes
|
105
115
|
|
106
|
-
|
107
|
-
|
116
|
+
Because requests to Rodauth endpoints are handled by Roda, Rodauth routes will
|
117
|
+
not show in `rails routes`. You can use the `rodauth:routes` rake task to view
|
118
|
+
the list of endpoints based on currently loaded features:
|
108
119
|
|
109
120
|
```sh
|
110
121
|
$ rails rodauth:routes
|
@@ -303,7 +314,9 @@ you'll want to start editing the markup. You can run the following command to
|
|
303
314
|
copy Rodauth templates into your Rails app:
|
304
315
|
|
305
316
|
```sh
|
306
|
-
$ rails generate rodauth:views
|
317
|
+
$ rails generate rodauth:views # bootstrap views
|
318
|
+
# or
|
319
|
+
$ rails generate rodauth:views --css=tailwind # tailwind views (requires @tailwindcss/forms plugin)
|
307
320
|
```
|
308
321
|
|
309
322
|
This will generate views for Rodauth features you have currently enabled into
|
@@ -602,9 +615,9 @@ Then in your application you can reference the secondary Rodauth instance:
|
|
602
615
|
rodauth(:admin).login_path #=> "/admin/login"
|
603
616
|
```
|
604
617
|
|
605
|
-
You'll likely want to save the information of which account belongs to which
|
618
|
+
*NOTE: You'll likely want to save the information of which account belongs to which
|
606
619
|
configuration to the database. See [this guide][account types] on how you can do
|
607
|
-
that
|
620
|
+
that.*
|
608
621
|
|
609
622
|
### Sharing configuration
|
610
623
|
|
@@ -846,6 +859,8 @@ helpers through `#rails_routes`:
|
|
846
859
|
class RodauthMain < Rodauth::Rails::Auth
|
847
860
|
configure do
|
848
861
|
login_redirect { rails_routes.activity_path }
|
862
|
+
change_password_redirect { rails_routes.profile_path }
|
863
|
+
change_login_redirect { rails_routes.profile_path }
|
849
864
|
end
|
850
865
|
end
|
851
866
|
```
|
@@ -43,8 +43,10 @@ Depending on your application's configuration some manual setup may be required:
|
|
43
43
|
|
44
44
|
5. You can copy Rodauth views (for customization) to your app by running:
|
45
45
|
|
46
|
-
rails g rodauth:views
|
46
|
+
rails g rodauth:views # default bootstrap views
|
47
47
|
|
48
|
-
|
48
|
+
rails g rodauth:views --css=tailwind # tailwind views (requires @tailwindcss/forms plugin)
|
49
|
+
|
50
|
+
* Not required *
|
49
51
|
|
50
52
|
===============================================================================
|
data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/_email_auth_request_form.html.erb
ADDED
@@ -0,0 +1,5 @@
|
|
1
|
+
<%= form_with url: rodauth.email_auth_request_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<%= form.hidden_field rodauth.login_param, value: params[rodauth.login_param] %>
|
3
|
+
|
4
|
+
<%= form.submit rodauth.email_auth_request_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
5
|
+
<% end %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<%= form_with url: rodauth.login_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<% if rodauth.skip_login_field_on_login? %>
|
3
|
+
<div class="mb-6">
|
4
|
+
<%= form.label "login", rodauth.login_label, class: "block text-sm font-semibold" %>
|
5
|
+
<%= form.email_field rodauth.login_param, value: params[rodauth.login_param], id: "login", readonly: true, class: "mt-2 text-sm w-full py-2 px-0 bg-inherit border-transparent focus:ring-0 focus:border-transparent" %>
|
6
|
+
</div>
|
7
|
+
<% else %>
|
8
|
+
<div class="mb-6">
|
9
|
+
<%= form.label "login", rodauth.login_label, class: "block text-sm font-semibold" %>
|
10
|
+
<%= form.email_field rodauth.login_param, value: params[rodauth.login_param], id: "login", autocomplete: "email", required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.login_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "login_error_message" } if rodauth.field_error(rodauth.login_param)) %>
|
11
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.login_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "login_error_message") if rodauth.field_error(rodauth.login_param) %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<% unless rodauth.skip_password_field_on_login? %>
|
16
|
+
<div class="mb-6">
|
17
|
+
<%= form.label "password", rodauth.password_label, class: "block text-sm font-semibold" %>
|
18
|
+
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
19
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
|
23
|
+
<%= form.submit rodauth.login_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
24
|
+
<% end %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<% unless rodauth.login_form_footer_links.empty? %>
|
2
|
+
<ul>
|
3
|
+
<% rodauth.login_form_footer_links.sort.each do |_, link, text| %>
|
4
|
+
<li><%= link_to text, link, class: "text-blue-600 rounded-sm text-sm hover:underline hover:text-blue-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 dark:text-blue-300 dark:hover:text-blue-400 dark:focus-visible:ring-2 dark:focus-visible:ring-blue-300" %></li>
|
5
|
+
<% end %>
|
6
|
+
</ul>
|
7
|
+
<% end %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<div>
|
2
|
+
<% if rodauth.recovery_codes.any? %>
|
3
|
+
<div class="text-sm px-4 py-3 bg-white rounded-lg border shadow-lg grid grid-cols-2 gap-y-2 gap-x-4 dark:bg-gray-900 dark:text-gray-200">
|
4
|
+
<% rodauth.recovery_codes.each do |code| %>
|
5
|
+
<div class="font-mono"><%= code %></div>
|
6
|
+
<% end %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<% if rodauth.can_add_recovery_codes? %>
|
11
|
+
<div class="text-2xl font-medium mt-6 mb-4">
|
12
|
+
<%== rodauth.add_recovery_codes_heading %>
|
13
|
+
</div>
|
14
|
+
<%= render template: "rodauth/recovery_codes", layout: false %>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%= form_with url: rodauth.change_login_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<div class="mb-6">
|
3
|
+
<%= form.label "login", rodauth.login_label, class: "block text-sm font-semibold" %>
|
4
|
+
<%= form.email_field rodauth.login_param, value: params[rodauth.login_param], id: "login", autocomplete: "email", required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.login_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "login_error_message" } if rodauth.field_error(rodauth.login_param)) %>
|
5
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.login_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "login_error_message") if rodauth.field_error(rodauth.login_param) %>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<% if rodauth.require_login_confirmation? %>
|
9
|
+
<div class="mb-6">
|
10
|
+
<%= form.label "login-confirm", rodauth.login_confirm_label, class: "block text-sm font-semibold" %>
|
11
|
+
<%= form.email_field rodauth.login_confirm_param, value: params[rodauth.login_confirm_param], id: "login-confirm", autocomplete: "email", required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.login_confirm_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "login-confirm_error_message" } if rodauth.field_error(rodauth.login_confirm_param)) %>
|
12
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.login_confirm_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "login-confirm_error_message") if rodauth.field_error(rodauth.login_confirm_param) %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<% if rodauth.change_login_requires_password? %>
|
17
|
+
<div class="mb-6">
|
18
|
+
<%= form.label "password", rodauth.password_label, class: "block text-sm font-semibold" %>
|
19
|
+
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
20
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
21
|
+
</div>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<%= form.submit rodauth.change_login_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
25
|
+
<% end %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%= form_with url: rodauth.change_password_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<% if rodauth.change_password_requires_password? %>
|
3
|
+
<div class="mb-6">
|
4
|
+
<%= form.label "password", rodauth.password_label, class: "block text-sm font-semibold" %>
|
5
|
+
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
6
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<div class="mb-6">
|
11
|
+
<%= form.label "new-password", rodauth.new_password_label, class: "block text-sm font-semibold" %>
|
12
|
+
<%= form.password_field rodauth.new_password_param, value: "", id: "new-password", autocomplete: "new-password", required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.new_password_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "new-password_error_message" } if rodauth.field_error(rodauth.new_password_param)) %>
|
13
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.new_password_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "new-password_error_message") if rodauth.field_error(rodauth.new_password_param) %>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<% if rodauth.require_password_confirmation? %>
|
17
|
+
<div class="mb-6">
|
18
|
+
<%= form.label "password-confirm", rodauth.password_confirm_label, class: "block text-sm font-semibold" %>
|
19
|
+
<%= form.password_field rodauth.password_confirm_param, value: "", id: "password-confirm", autocomplete: "new-password", required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_confirm_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password-confirm_error_message" } if rodauth.field_error(rodauth.password_confirm_param)) %>
|
20
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_confirm_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password-confirm_error_message") if rodauth.field_error(rodauth.password_confirm_param) %>
|
21
|
+
</div>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<%= form.submit rodauth.change_password_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
25
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= form_with url: rodauth.close_account_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<% if rodauth.close_account_requires_password? %>
|
3
|
+
<div class="mb-6">
|
4
|
+
<%= form.label "password", rodauth.password_label, class: "block text-sm font-semibold" %>
|
5
|
+
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
6
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<%= form.submit rodauth.close_account_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-600 dark:bg-red-400 dark:hover:bg-red-500 dark:text-gray-900 dark:focus:ring-red-400 dark:focus:ring-offset-current" %>
|
11
|
+
<% end %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%= form_with url: rodauth.confirm_password_path, method: :post, data: { turbo: false } do |form| %>
|
2
|
+
<div class="dark:bg-gray-900 flex items-center justify-center h-screen">
|
3
|
+
<div class="max-w-sm">
|
4
|
+
<h2 class="mb-3 text-3xl font-semibold text-center dark:text-gray-100">
|
5
|
+
<%= rodauth.confirm_password_page_title %>
|
6
|
+
</h2>
|
7
|
+
<div class="mx-4">
|
8
|
+
<div class="py-2">
|
9
|
+
<%= form.label "password", rodauth.password_label, class: "text-sm text-gray-400" %>
|
10
|
+
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "w-full px-3 py-2 border rounded-md border-gray-400 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100 focus:dark:border-emerald-400 focus:dark:bg-gray-700 invalid:border-red-500 invalid:text-red-600 focus:invalid:border-red-500 focus:invalid:ring-red-500 valid:border-green-500 #{"border rounded-md border-red-500" if rodauth.field_error(rodauth.password_param)}", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
11
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "text-red-800 text-xs mt-1 ml-1", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
<div class="py-2">
|
15
|
+
<%= form.submit rodauth.confirm_password_button, class: "w-full px-8 py-2 font-semibold rounded-md w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 dark:bg-emerald-400 dark:text-gray-900" %>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
<% end %>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<%= form_with url: rodauth.create_account_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<div class="mb-6">
|
3
|
+
<%= form.label "login", rodauth.login_label, class: "block text-sm font-semibold" %>
|
4
|
+
<%= form.email_field rodauth.login_param, value: params[rodauth.login_param], id: "login", autocomplete: "email", required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.login_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "login_error_message" } if rodauth.field_error(rodauth.login_param)) %>
|
5
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.login_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "login_error_message") if rodauth.field_error(rodauth.login_param) %>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<% if rodauth.require_login_confirmation? %>
|
9
|
+
<div class="mb-6">
|
10
|
+
<%= form.label "login-confirm", rodauth.login_confirm_label, class: "block text-sm font-semibold" %>
|
11
|
+
<%= form.email_field rodauth.login_confirm_param, value: params[rodauth.login_confirm_param], id: "login-confirm", autocomplete: "email", required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.login_confirm_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "login-confirm_error_message" } if rodauth.field_error(rodauth.login_confirm_param)) %>
|
12
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.login_confirm_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "login-confirm_error_message") if rodauth.field_error(rodauth.login_confirm_param) %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<% if rodauth.create_account_set_password? %>
|
17
|
+
<div class="mb-6">
|
18
|
+
<%= form.label "password", rodauth.password_label, class: "block text-sm font-semibold" %>
|
19
|
+
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
20
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<% if rodauth.require_password_confirmation? %>
|
24
|
+
<div class="mb-6">
|
25
|
+
<%= form.label "password-confirm", rodauth.password_confirm_label, class: "block text-sm font-semibold" %>
|
26
|
+
<%= form.password_field rodauth.password_confirm_param, value: "", id: "password-confirm", autocomplete: "new-password", required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_confirm_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password-confirm_error_message" } if rodauth.field_error(rodauth.password_confirm_param)) %>
|
27
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_confirm_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password-confirm_error_message") if rodauth.field_error(rodauth.password_confirm_param) %>
|
28
|
+
</div>
|
29
|
+
<% end %>
|
30
|
+
<% end %>
|
31
|
+
|
32
|
+
<%= form.submit rodauth.create_account_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
33
|
+
<% end %>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<%= form_with url: rodauth.email_auth_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<%= form.submit rodauth.login_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
3
|
+
<% end %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%= form_with url: rodauth.logout_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<% if rodauth.features.include?(:active_sessions) %>
|
3
|
+
<div class="mb-6 flex items-center space-x-2">
|
4
|
+
<%= form.check_box rodauth.global_logout_param, id: "global-logout", class: "rounded dark:bg-gray-900 dark:border-gray-600 dark:checked:bg-current dark:checked:border-current dark:checked:text-emerald-400 dark:focus:ring-emerald-400 dark:focus:ring-offset-gray-900", include_hidden: false %>
|
5
|
+
<%= form.label "global-logout", rodauth.global_logout_label, class: "text-sm" %>
|
6
|
+
</div>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<%= form.submit rodauth.logout_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md bg-yellow-300 hover:bg-yellow-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-yellow-300 dark:bg-violet-400 dark:hover:bg-violet-500 dark:text-gray-900 dark:focus:ring-violet-400 dark:focus:ring-offset-current" %>
|
10
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%= form_with url: rodauth.otp_auth_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<div class="mb-6">
|
3
|
+
<%= form.label "otp-auth-code", rodauth.otp_auth_label, class: "block text-sm font-semibold" %>
|
4
|
+
<%= form.text_field rodauth.otp_auth_param, value: "", id: "otp-auth-code", autocomplete: "off", inputmode: "numeric", required: true, class: "mt-2 text-sm w-1/2 px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.otp_auth_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "otp-auth-code_error_message" } if rodauth.field_error(rodauth.otp_auth_param)) %>
|
5
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.otp_auth_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "otp-auth-code_error_message") if rodauth.field_error(rodauth.otp_auth_param) %>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<%= form.submit rodauth.otp_auth_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
9
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= form_with url: rodauth.otp_disable_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<% if rodauth.two_factor_modifications_require_password? %>
|
3
|
+
<div class="mb-6">
|
4
|
+
<%= form.label "password", rodauth.password_label, class: "block text-sm font-semibold" %>
|
5
|
+
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
6
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<%= form.submit rodauth.otp_disable_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md bg-yellow-300 hover:bg-yellow-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-yellow-300 dark:bg-violet-400 dark:hover:bg-violet-500 dark:text-gray-900 dark:focus:ring-violet-400 dark:focus:ring-offset-current" %>
|
11
|
+
<% end %>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<%= form_with url: rodauth.otp_setup_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<%= form.hidden_field rodauth.otp_setup_param, value: rodauth.otp_user_key, id: "otp-key" %>
|
3
|
+
<%= form.hidden_field rodauth.otp_setup_raw_param, value: rodauth.otp_key, id: "otp-hmac-secret" if rodauth.otp_keys_use_hmac? %>
|
4
|
+
|
5
|
+
<div class="mb-6 w-48">
|
6
|
+
<%== rodauth.otp_qr_code %>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<dl class="mb-6 text-sm">
|
10
|
+
<dt class="font-semibold"><%= rodauth.otp_secret_label %>:</dt>
|
11
|
+
<dd><%= rodauth.otp_user_key %></dd>
|
12
|
+
|
13
|
+
<dt class="font-semibold mt-2"><%= rodauth.otp_provisioning_uri_label %>:</dt>
|
14
|
+
<dd><%= rodauth.otp_provisioning_uri %></dd>
|
15
|
+
</dl>
|
16
|
+
|
17
|
+
<% if rodauth.two_factor_modifications_require_password? %>
|
18
|
+
<div class="mb-6">
|
19
|
+
<%= form.label "password", rodauth.password_label, class: "block text-sm font-semibold" %>
|
20
|
+
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
21
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<div class="mb-6">
|
26
|
+
<%= form.label "otp-auth-code", rodauth.otp_auth_label, class: "block text-sm font-semibold" %>
|
27
|
+
<%= form.text_field rodauth.otp_auth_param, value: "", id: "otp-auth-code", autocomplete: "off", inputmode: "numeric", required: true, class: "mt-2 text-sm w-1/2 px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.otp_auth_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "otp-auth-code_error_message" } if rodauth.field_error(rodauth.otp_auth_param)) %>
|
28
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.otp_auth_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "otp-auth-code_error_message") if rodauth.field_error(rodauth.otp_auth_param) %>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<%= form.submit rodauth.otp_setup_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
32
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%= form_with url: rodauth.recovery_auth_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<div class="mb-6">
|
3
|
+
<%= form.label "recovery-code", rodauth.recovery_codes_label, class: "block text-sm font-semibold" %>
|
4
|
+
<%= form.text_field rodauth.recovery_codes_param, value: "", id: "recovery-code", autocomplete: "off", required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.recovery_codes_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "recovery-code_error_message" } if rodauth.field_error(rodauth.recovery_codes_param)) %>
|
5
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.recovery_codes_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "recovery-code_error_message") if rodauth.field_error(rodauth.recovery_codes_param) %>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<%= form.submit rodauth.recovery_auth_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
9
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= form_with url: rodauth.recovery_codes_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<% if rodauth.two_factor_modifications_require_password? %>
|
3
|
+
<div class="mb-6">
|
4
|
+
<%= form.label "password", rodauth.password_label, class: "block text-sm font-semibold" %>
|
5
|
+
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
6
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<%= form.submit rodauth.recovery_codes_button || rodauth.view_recovery_codes_button, name: (rodauth.add_recovery_codes_param if rodauth.recovery_codes_button), class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
11
|
+
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<%= form_with url: rodauth.remember_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<fieldset class="mb-6 space-y-2">
|
3
|
+
<div class="flex items-center space-x-2">
|
4
|
+
<%= form.radio_button rodauth.remember_param, rodauth.remember_remember_param_value, id: "remember-remember", class: "dark:bg-gray-900 dark:border-gray-600 dark:checked:bg-current dark:checked:border-current dark:checked:text-emerald-400 dark:focus:ring-emerald-400 dark:focus:ring-offset-gray-900" %>
|
5
|
+
<%= form.label "remember-remember", rodauth.remember_remember_label, class: "text-sm" %>
|
6
|
+
</div>
|
7
|
+
<div class="flex items-center space-x-2">
|
8
|
+
<%= form.radio_button rodauth.remember_param, rodauth.remember_forget_param_value, id: "remember-forget", class: "dark:bg-gray-900 dark:border-gray-600 dark:checked:bg-current dark:checked:border-current dark:checked:text-emerald-400 dark:focus:ring-emerald-400 dark:focus:ring-offset-gray-900" %>
|
9
|
+
<%= form.label "remember-forget", rodauth.remember_forget_label, class: "text-sm" %>
|
10
|
+
</div>
|
11
|
+
<div class="flex items-center space-x-2">
|
12
|
+
<%= form.radio_button rodauth.remember_param, rodauth.remember_disable_param_value, id: "remember-disable", class: "dark:bg-gray-900 dark:border-gray-600 dark:checked:bg-current dark:checked:border-current dark:checked:text-emerald-400 dark:focus:ring-emerald-400 dark:focus:ring-offset-gray-900" %>
|
13
|
+
<%= form.label "remember-disable", rodauth.remember_disable_label, class: "text-sm" %>
|
14
|
+
</div>
|
15
|
+
</fieldset>
|
16
|
+
|
17
|
+
<%= form.submit rodauth.remember_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
18
|
+
<% end %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%= form_with url: rodauth.reset_password_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<div class="mb-6">
|
3
|
+
<%= form.label "password", rodauth.password_label, class: "block text-sm font-semibold" %>
|
4
|
+
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
5
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<% if rodauth.require_password_confirmation? %>
|
9
|
+
<div class="mb-6">
|
10
|
+
<%= form.label "password-confirm", rodauth.password_confirm_label, class: "block text-sm font-semibold" %>
|
11
|
+
<%= form.password_field rodauth.password_confirm_param, value: "", id: "password-confirm", autocomplete: "new-password", required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_confirm_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password-confirm_error_message" } if rodauth.field_error(rodauth.password_confirm_param)) %>
|
12
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_confirm_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password-confirm_error_message") if rodauth.field_error(rodauth.password_confirm_param) %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= form.submit rodauth.reset_password_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
17
|
+
<% end %>
|
data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/reset_password_request.html.erb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
<%= form_with url: rodauth.reset_password_request_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<div class="mb-4 text-sm">
|
3
|
+
<%== rodauth.reset_password_explanatory_text %>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<% if params[rodauth.login_param] && !rodauth.field_error(rodauth.login_param) %>
|
7
|
+
<%= form.hidden_field rodauth.login_param, value: params[rodauth.login_param] %>
|
8
|
+
<% else %>
|
9
|
+
<div class="mb-6">
|
10
|
+
<%= form.label "login", rodauth.login_label, class: "block text-sm font-semibold" %>
|
11
|
+
<%= form.email_field rodauth.login_param, value: params[rodauth.login_param], id: "login", autocomplete: "email", required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.login_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "login_error_message" } if rodauth.field_error(rodauth.login_param)) %>
|
12
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.login_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "login_error_message") if rodauth.field_error(rodauth.login_param) %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= form.submit rodauth.reset_password_request_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
17
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%= form_with url: rodauth.sms_auth_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<div class="mb-6">
|
3
|
+
<%= form.label "sms-code", rodauth.sms_code_label, class: "block text-sm font-semibold" %>
|
4
|
+
<%= form.text_field rodauth.sms_code_param, value: "", id: "sms-code", autocomplete: "one-time-code", inputmode: "numeric", required: true, class: "mt-2 text-sm w-1/2 px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.sms_code_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "sms-code_error_message" } if rodauth.field_error(rodauth.sms_code_param)) %>
|
5
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.sms_code_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "sms-code_error_message") if rodauth.field_error(rodauth.sms_code_param) %>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<%= form.submit rodauth.sms_auth_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
9
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%= form_with url: rodauth.sms_confirm_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<div class="mb-6">
|
3
|
+
<%= form.label "sms-code", rodauth.sms_code_label, class: "block text-sm font-semibold" %>
|
4
|
+
<%= form.text_field rodauth.sms_code_param, value: "", id: "sms-code", autocomplete: "one-time-code", inputmode: "numeric", required: true, class: "mt-2 text-sm w-1/2 px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.sms_code_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "sms-code_error_message" } if rodauth.field_error(rodauth.sms_code_param)) %>
|
5
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.sms_code_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "sms-code_error_message") if rodauth.field_error(rodauth.sms_code_param) %>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<%= form.submit rodauth.sms_confirm_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
9
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= form_with url: rodauth.sms_disable_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<% if rodauth.two_factor_modifications_require_password? %>
|
3
|
+
<div class="mb-6">
|
4
|
+
<%= form.label "password", rodauth.password_label, class: "block text-sm font-semibold" %>
|
5
|
+
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
6
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<%= form.submit rodauth.sms_disable_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
11
|
+
<% end %>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<%= form_with url: rodauth.sms_request_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<%= form.submit rodauth.sms_request_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
3
|
+
<% end %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%= form_with url: rodauth.sms_setup_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<% if rodauth.two_factor_modifications_require_password? %>
|
3
|
+
<div class="mb-6">
|
4
|
+
<%= form.label "password", rodauth.password_label, class: "block text-sm font-semibold" %>
|
5
|
+
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
6
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<div class="mb-6">
|
11
|
+
<%= form.label "sms-phone", rodauth.sms_phone_label, class: "block text-sm font-semibold" %>
|
12
|
+
<%= form.telephone_field rodauth.sms_phone_param, value: "", id: "sms-phone", autocomplete: "tel", required: true, class: "mt-2 text-sm w-1/2 px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.sms_phone_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "sms-phone_error_message" } if rodauth.field_error(rodauth.sms_phone_param)) %>
|
13
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.sms_phone_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "sms-phone_error_message") if rodauth.field_error(rodauth.sms_phone_param) %>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<%= form.submit rodauth.sms_setup_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
17
|
+
<% end %>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<ul>
|
2
|
+
<% rodauth.two_factor_auth_links.sort.each do |_, link, text| %>
|
3
|
+
<li><%= link_to text, link, class: "text-blue-600 rounded-sm text-sm hover:underline hover:text-blue-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 dark:text-blue-300 dark:hover:text-blue-400 dark:focus-visible:ring-2 dark:focus-visible:ring-blue-300" %></li>
|
4
|
+
<% end %>
|
5
|
+
</ul>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= form_with url: rodauth.two_factor_disable_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<% if rodauth.two_factor_modifications_require_password? %>
|
3
|
+
<div class="mb-6">
|
4
|
+
<%= form.label "password", rodauth.password_label, class: "block text-sm font-semibold" %>
|
5
|
+
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
6
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<%= form.submit rodauth.two_factor_disable_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md bg-yellow-300 hover:bg-yellow-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-yellow-300 dark:bg-violet-400 dark:hover:bg-violet-500 dark:text-gray-900 dark:focus:ring-violet-400 dark:focus:ring-offset-current" %>
|
11
|
+
<% end %>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<div>
|
2
|
+
<% if rodauth.two_factor_setup_links.any? %>
|
3
|
+
<div class="text-2xl font-medium">
|
4
|
+
<%== rodauth.two_factor_setup_heading %>
|
5
|
+
</div>
|
6
|
+
<ul class="mt-1">
|
7
|
+
<% rodauth.two_factor_setup_links.sort.each do |_, link, text| %>
|
8
|
+
<li><%= link_to text, link, class: "text-blue-600 rounded-sm text-sm hover:underline hover:text-blue-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 dark:text-blue-300 dark:hover:text-blue-400 dark:focus-visible:ring-2 dark:focus-visible:ring-blue-300" %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<% if rodauth.two_factor_remove_links.any? %>
|
14
|
+
<div class="text-2xl font-medium mt-4">
|
15
|
+
<%== rodauth.two_factor_remove_heading %>
|
16
|
+
</div>
|
17
|
+
<ul class="mt-1">
|
18
|
+
<% rodauth.two_factor_remove_links.sort.each do |_, link, text| %>
|
19
|
+
<li><%= link_to text, link, class: "text-blue-600 rounded-sm text-sm hover:underline hover:text-blue-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 dark:text-blue-300 dark:hover:text-blue-400 dark:focus-visible:ring-2 dark:focus-visible:ring-blue-300" %></li>
|
20
|
+
<% end %>
|
21
|
+
<% if rodauth.two_factor_remove_links.length > 1 %>
|
22
|
+
<li><%= link_to rodauth.two_factor_disable_link_text, rodauth.two_factor_disable_path, class: "text-blue-600 rounded-sm text-sm hover:underline hover:text-blue-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 dark:text-blue-300 dark:hover:text-blue-400 dark:focus-visible:ring-2 dark:focus-visible:ring-blue-300" %></li>
|
23
|
+
<% end %>
|
24
|
+
</ul>
|
25
|
+
<% end %>
|
26
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<%= form_with url: rodauth.unlock_account_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<div class="mb-4 text-sm">
|
3
|
+
<%== rodauth.unlock_account_explanatory_text %>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<% if rodauth.unlock_account_requires_password? %>
|
7
|
+
<div class="mb-6">
|
8
|
+
<%= form.label "password", rodauth.password_label, class: "block text-sm font-semibold" %>
|
9
|
+
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
10
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<%= form.submit rodauth.unlock_account_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
15
|
+
<% end %>
|
data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/unlock_account_request.html.erb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
<%= form_with url: rodauth.unlock_account_request_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<div class="mb-4 text-sm">
|
3
|
+
<%== rodauth.unlock_account_request_explanatory_text %>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<%= form.hidden_field rodauth.login_param, value: params[rodauth.login_param] %>
|
7
|
+
|
8
|
+
<%= form.submit rodauth.unlock_account_request_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
9
|
+
<% end %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%= form_with url: rodauth.verify_account_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<% if rodauth.verify_account_set_password? %>
|
3
|
+
<div class="mb-6">
|
4
|
+
<%= form.label "password", rodauth.password_label, class: "block text-sm font-semibold" %>
|
5
|
+
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
6
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<% if rodauth.require_password_confirmation? %>
|
10
|
+
<div class="mb-6">
|
11
|
+
<%= form.label "password-confirm", rodauth.password_confirm_label, class: "block text-sm font-semibold" %>
|
12
|
+
<%= form.password_field rodauth.password_confirm_param, value: "", id: "password-confirm", autocomplete: "new-password", required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.password_confirm_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "password-confirm_error_message" } if rodauth.field_error(rodauth.password_confirm_param)) %>
|
13
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.password_confirm_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "password-confirm_error_message") if rodauth.field_error(rodauth.password_confirm_param) %>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<%= form.submit rodauth.verify_account_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
19
|
+
<% end %>
|
data/lib/generators/rodauth/templates/app/views/rodauth/tailwind/verify_account_resend.html.erb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
<%= form_with url: rodauth.verify_account_resend_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<div class="mb-4 text-sm">
|
3
|
+
<%== rodauth.verify_account_resend_explanatory_text %>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<% if params[rodauth.login_param] %>
|
7
|
+
<%= form.hidden_field rodauth.login_param, value: params[rodauth.login_param] %>
|
8
|
+
<% else %>
|
9
|
+
<div class="mb-6">
|
10
|
+
<%= form.label "login", rodauth.login_label, class: "block text-sm font-semibold" %>
|
11
|
+
<%= form.email_field rodauth.login_param, value: params[rodauth.login_param], id: "login", autocomplete: "email", required: true, class: "mt-2 text-sm w-full px-3 py-2 border rounded-md dark:bg-gray-900 dark:text-gray-100 dark:focus:bg-gray-800 #{rodauth.field_error(rodauth.login_param) ? "border-red-600 focus:ring-red-600 focus:border-red-600 dark:border-red-400 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-700 dark:focus:border-emerald-400 dark:focus:ring-emerald-400" }", aria: ({ invalid: true, describedby: "login_error_message" } if rodauth.field_error(rodauth.login_param)) %>
|
12
|
+
<%= content_tag(:span, rodauth.field_error(rodauth.login_param), class: "block mt-1 text-red-600 text-xs dark:text-red-400", id: "login_error_message") if rodauth.field_error(rodauth.login_param) %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= form.submit rodauth.verify_account_resend_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
17
|
+
<% end %>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<%= form_with url: rodauth.verify_login_change_path, method: :post, data: { turbo: false }, class: "w-full max-w-sm" do |form| %>
|
2
|
+
<%= form.submit rodauth.verify_login_change_button, class: "w-full px-8 py-3 cursor-pointer font-semibold text-sm rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:text-gray-900 dark:focus:ring-emerald-400 dark:focus:ring-offset-current" %>
|
3
|
+
<% end %>
|
@@ -14,6 +14,10 @@ module Rodauth
|
|
14
14
|
desc: "Generates views for all Rodauth features",
|
15
15
|
default: false
|
16
16
|
|
17
|
+
class_option :css, type: :string, enum: %w[bootstrap tailwind tailwindcss],
|
18
|
+
desc: "CSS framework to generate views for",
|
19
|
+
default: "bootstrap"
|
20
|
+
|
17
21
|
class_option :name, aliases: "-n", type: :string,
|
18
22
|
desc: "The configuration name for which to generate views",
|
19
23
|
default: nil
|
@@ -49,7 +53,7 @@ module Rodauth
|
|
49
53
|
validate_features or return
|
50
54
|
|
51
55
|
views.each do |view|
|
52
|
-
copy_file
|
56
|
+
copy_file view_location(view), "app/views/#{directory}/#{view}.html.erb" do |content|
|
53
57
|
content = content.gsub("rodauth.", "rodauth(:#{configuration_name}).") if configuration_name
|
54
58
|
content = content.gsub("rodauth/", "#{directory}/")
|
55
59
|
content = form_helpers_compatibility(content) if ActionView.version < Gem::Version.new("5.1")
|
@@ -115,6 +119,19 @@ module Rodauth
|
|
115
119
|
.gsub(/form\.radio_button (\S+), (\S+),/, 'radio_button_tag \1, \2, false,')
|
116
120
|
.gsub(/form\.check_box (\S+), (.+) /, 'check_box_tag \1, "t", false, \2 ')
|
117
121
|
end
|
122
|
+
|
123
|
+
def view_location(view)
|
124
|
+
if tailwind?
|
125
|
+
"app/views/rodauth/tailwind/#{view}.html.erb"
|
126
|
+
else
|
127
|
+
"app/views/rodauth/#{view}.html.erb"
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
def tailwind?
|
132
|
+
::Rails.application.config.generators.options[:rails][:template_engine] == :tailwindcss ||
|
133
|
+
options[:css]&.downcase&.start_with?("tailwind")
|
134
|
+
end
|
118
135
|
end
|
119
136
|
end
|
120
137
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rodauth-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janko Marohnić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -251,6 +251,41 @@ files:
|
|
251
251
|
- lib/generators/rodauth/templates/app/views/rodauth/sms_disable.html.erb
|
252
252
|
- lib/generators/rodauth/templates/app/views/rodauth/sms_request.html.erb
|
253
253
|
- lib/generators/rodauth/templates/app/views/rodauth/sms_setup.html.erb
|
254
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/_email_auth_request_form.html.erb
|
255
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/_login_form.html.erb
|
256
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/_login_form_footer.html.erb
|
257
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/_login_form_header.html.erb
|
258
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/add_recovery_codes.html.erb
|
259
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/change_login.html.erb
|
260
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/change_password.html.erb
|
261
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/close_account.html.erb
|
262
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/confirm_password.html.erb
|
263
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/create_account.html.erb
|
264
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/email_auth.html.erb
|
265
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/login.html.erb
|
266
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/logout.html.erb
|
267
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/multi_phase_login.html.erb
|
268
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/otp_auth.html.erb
|
269
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/otp_disable.html.erb
|
270
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/otp_setup.html.erb
|
271
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/recovery_auth.html.erb
|
272
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/recovery_codes.html.erb
|
273
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/remember.html.erb
|
274
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/reset_password.html.erb
|
275
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/reset_password_request.html.erb
|
276
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/sms_auth.html.erb
|
277
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/sms_confirm.html.erb
|
278
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/sms_disable.html.erb
|
279
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/sms_request.html.erb
|
280
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/sms_setup.html.erb
|
281
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/two_factor_auth.html.erb
|
282
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/two_factor_disable.html.erb
|
283
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/two_factor_manage.html.erb
|
284
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/unlock_account.html.erb
|
285
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/unlock_account_request.html.erb
|
286
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/verify_account.html.erb
|
287
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/verify_account_resend.html.erb
|
288
|
+
- lib/generators/rodauth/templates/app/views/rodauth/tailwind/verify_login_change.html.erb
|
254
289
|
- lib/generators/rodauth/templates/app/views/rodauth/two_factor_auth.html.erb
|
255
290
|
- lib/generators/rodauth/templates/app/views/rodauth/two_factor_disable.html.erb
|
256
291
|
- lib/generators/rodauth/templates/app/views/rodauth/two_factor_manage.html.erb
|