Migrate to Rais 8.0
- Remove all Rodauth stuff and implement simple custom auth - Migrate from sprockets to propshaft, hack some bootstrap stuff
This commit is contained in:
parent
0198a22278
commit
c35c7da6e0
66 changed files with 518 additions and 684 deletions
2
app/views/home/profile.html.slim
Normal file
2
app/views/home/profile.html.slim
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
pre
|
||||
== JSON.pretty_generate(Current.session.attributes.merge(user: Current.session.user.attributes))
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<% if @sidebar_items %>
|
||||
<% @sidebar_items.each do |sidebar_item| %>
|
||||
<% if sidebar_item[:method].present? && sidebar_item[:method] != :get %>
|
||||
<%= button_to(sidebar_item[:path], method: sidebar_item[:method], class: "list-group-item border-end-0 d-inline-block text-truncate") do %>
|
||||
<%= button_to(sidebar_item[:path], method: sidebar_item[:method], class: "list-group-item border-0 d-inline-block text-truncate") do %>
|
||||
<% if sidebar_item[:icon] %>
|
||||
<span aria-hidden="true" class="bi-<%= sidebar_item[:icon] %>"></span>
|
||||
<% end %>
|
||||
|
|
|
|||
9
app/views/passwords/edit.html.erb
Normal file
9
app/views/passwords/edit.html.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<h1>Update your password</h1>
|
||||
|
||||
<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %>
|
||||
|
||||
<%= form_with url: password_path(params[:token]), method: :put do |form| %>
|
||||
<%= form.password_field :password, required: true, autocomplete: "new-password", placeholder: "Enter new password", maxlength: 72 %><br>
|
||||
<%= form.password_field :password_confirmation, required: true, autocomplete: "new-password", placeholder: "Repeat new password", maxlength: 72 %><br>
|
||||
<%= form.submit "Save" %>
|
||||
<% end %>
|
||||
8
app/views/passwords/new.html.erb
Normal file
8
app/views/passwords/new.html.erb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<h1>Forgot your password?</h1>
|
||||
|
||||
<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %>
|
||||
|
||||
<%= form_with url: passwords_path do |form| %>
|
||||
<%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address] %><br>
|
||||
<%= form.submit "Email reset instructions" %>
|
||||
<% end %>
|
||||
4
app/views/passwords_mailer/reset.html.erb
Normal file
4
app/views/passwords_mailer/reset.html.erb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<p>
|
||||
You can reset your password within the next 15 minutes on
|
||||
<%= link_to "this password reset page", edit_password_url(@user.password_reset_token) %>.
|
||||
</p>
|
||||
2
app/views/passwords_mailer/reset.text.erb
Normal file
2
app/views/passwords_mailer/reset.text.erb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
You can reset your password within the next 15 minutes on this password reset page:
|
||||
<%= edit_password_url(@user.password_reset_token) %>
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
<%= form_with url: rodauth.login_path, method: :post, data: { turbo: false } do |form| %>
|
||||
<% if rodauth.skip_login_field_on_login? %>
|
||||
<div class="form-group mb-3">
|
||||
<%= form.label "login", rodauth.login_label, class: "form-label" %>
|
||||
<%= form.email_field rodauth.login_param, value: params[rodauth.login_param], id: "login", readonly: true, class: "form-control-plaintext" %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="form-group mb-3">
|
||||
<%= form.label "login", rodauth.login_label, class: "form-label" %>
|
||||
<%= form.email_field rodauth.login_param, value: params[rodauth.login_param], id: "login", autocomplete: rodauth.login_field_autocomplete_value, required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.login_param)}", aria: ({ invalid: true, describedby: "login_error_message" } if rodauth.field_error(rodauth.login_param)) %>
|
||||
<%= content_tag(:span, rodauth.field_error(rodauth.login_param), class: "invalid-feedback", id: "login_error_message") if rodauth.field_error(rodauth.login_param) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% unless rodauth.skip_password_field_on_login? %>
|
||||
<div class="form-group mb-3">
|
||||
<%= form.label "password", rodauth.password_label, class: "form-label" %>
|
||||
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.password_param)}", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
||||
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "invalid-feedback", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<%= form.submit rodauth.login_button, class: "btn btn-primary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<% unless rodauth.login_form_footer_links.empty? %>
|
||||
<%== rodauth.login_form_footer_links_heading %>
|
||||
|
||||
<ul>
|
||||
<% rodauth.login_form_footer_links.sort.each do |_, link, text| %>
|
||||
<li><%= link_to text, link %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<h1>Passwort ändern</h1>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<%= form_with url: rodauth.change_password_path, method: :post, data: { turbo: false } do |form| %>
|
||||
<% if rodauth.change_password_requires_password? %>
|
||||
<div class="form-group mb-3">
|
||||
<%= form.label "password", rodauth.password_label, class: "form-label" %>
|
||||
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.password_param)}", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
||||
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "invalid-feedback", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<%= form.label "new-password", rodauth.new_password_label, class: "form-label" %>
|
||||
<%= form.password_field rodauth.new_password_param, value: "", id: "new-password", autocomplete: "new-password", required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.new_password_param)}", aria: ({ invalid: true, describedby: "new-password_error_message" } if rodauth.field_error(rodauth.new_password_param)) %>
|
||||
<%= content_tag(:span, rodauth.field_error(rodauth.new_password_param), class: "invalid-feedback", id: "new-password_error_message") if rodauth.field_error(rodauth.new_password_param) %>
|
||||
</div>
|
||||
|
||||
<% if rodauth.require_password_confirmation? %>
|
||||
<div class="form-group mb-3">
|
||||
<%= form.label "password-confirm", rodauth.password_confirm_label, class: "form-label" %>
|
||||
<%= form.password_field rodauth.password_confirm_param, value: "", id: "password-confirm", autocomplete: "new-password", required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.password_confirm_param)}", aria: ({ invalid: true, describedby: "password-confirm_error_message" } if rodauth.field_error(rodauth.password_confirm_param)) %>
|
||||
<%= content_tag(:span, rodauth.field_error(rodauth.password_confirm_param), class: "invalid-feedback", id: "password-confirm_error_message") if rodauth.field_error(rodauth.password_confirm_param) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<%= form.submit rodauth.change_password_button, class: "btn btn-primary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
<%== rodauth.login_form_header %>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<%= render "login_form" %>
|
||||
</div>
|
||||
</div>
|
||||
<%== rodauth.login_form_footer %>
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<h1>Adieu</h1>
|
||||
<%= form_with url: rodauth.logout_path, method: :post, data: { turbo: false } do |form| %>
|
||||
<% if rodauth.features.include?(:active_sessions) %>
|
||||
<div class="form-group mb-3">
|
||||
<div class="form-check">
|
||||
<%= form.check_box rodauth.global_logout_param, id: "global-logout", class: "form-check-input", include_hidden: false %>
|
||||
<%= form.label "global-logout", rodauth.global_logout_label, class: "form-check-label" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="form-group mb-3">
|
||||
<%= form.submit "Log out", class: "btn btn-warning" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
<%== rodauth.login_form_header %>
|
||||
<%== rodauth.render_multi_phase_login_forms %>
|
||||
<%== rodauth.login_form_footer %>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
<h1><%= current_account.email %></h1>
|
||||
|
||||
<pre><%= JSON.pretty_generate current_account.attributes %></pre>
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<%= form_with url: rodauth.remember_path, method: :post, data: { turbo: false } do |form| %>
|
||||
<fieldset class="form-group mb-3">
|
||||
<div class="form-check">
|
||||
<%= form.radio_button rodauth.remember_param, rodauth.remember_remember_param_value, id: "remember-remember", class: "form-check-input" %>
|
||||
<%= form.label "remember-remember", rodauth.remember_remember_label, class: "form-check-label" %>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<%= form.radio_button rodauth.remember_param, rodauth.remember_forget_param_value, id: "remember-forget", class: "form-check-input" %>
|
||||
<%= form.label "remember-forget", rodauth.remember_forget_label, class: "form-check-label" %>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<%= form.radio_button rodauth.remember_param, rodauth.remember_disable_param_value, id: "remember-disable", class: "form-check-input" %>
|
||||
<%= form.label "remember-disable", rodauth.remember_disable_label, class: "form-check-label" %>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<%= form.submit rodauth.remember_button, class: "btn btn-primary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
13
app/views/sessions/new.html.slim
Normal file
13
app/views/sessions/new.html.slim
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
= tag.div(flash[:alert], style: "color:red") if flash[:alert]
|
||||
= tag.div(flash[:notice], style: "color:green") if flash[:notice]
|
||||
|
||||
h1 Login
|
||||
|
||||
= bootstrap_form_with url: session_path do |form|
|
||||
= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address], label: User.human_attribute_name(:email_address)
|
||||
br
|
||||
= form.password_field :password, required: true, autocomplete: "current-password", placeholder: "Enter your password", maxlength: 72, label: User.human_attribute_name(:password)
|
||||
br
|
||||
= form.submit "Login"
|
||||
br
|
||||
= link_to "Forgot password?", new_password_path
|
||||
Loading…
Add table
Add a link
Reference in a new issue