mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-04 21:15:19 +02:00
Improve password reset flow, normalize translations
This commit is contained in:
parent
cee9692b35
commit
f2739b79fb
22 changed files with 58 additions and 69 deletions
|
@ -101,7 +101,7 @@
|
|||
}
|
||||
|
||||
.btn {
|
||||
@apply px-3 py-2 rounded-lg text-sm font-medium cursor-pointer;
|
||||
@apply px-3 py-2 rounded-lg text-sm font-medium cursor-pointer focus:outline-gray-500;
|
||||
}
|
||||
|
||||
.btn--primary {
|
||||
|
|
|
@ -16,7 +16,7 @@ class PasswordResetsController < ApplicationController
|
|||
).password_reset.deliver_later
|
||||
end
|
||||
|
||||
redirect_to root_path, notice: t(".requested")
|
||||
redirect_to new_password_reset_path(step: "pending")
|
||||
end
|
||||
|
||||
def edit
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class ApplicationMailer < ActionMailer::Base
|
||||
default from: ENV["EMAIL_SENDER"] if ENV["EMAIL_SENDER"].present?
|
||||
default from: email_address_with_name(ENV.fetch("EMAIL_SENDER", "sender@maybe.local"), "Maybe Finance")
|
||||
layout "mailer"
|
||||
end
|
||||
|
|
|
@ -3,17 +3,8 @@
|
|||
%>
|
||||
|
||||
<%= styled_form_with model: @user, url: password_reset_path(token: params[:token]), method: :patch, class: "space-y-4" do |form| %>
|
||||
<div class="relative border border-gray-100 bg-gray-25 rounded-xl focus-within:bg-white focus-within:shadow focus-within:opacity-100">
|
||||
<%= form.label :password, class: "p-4 pb-0 block text-sm font-medium text-gray-700" %>
|
||||
<%= form.password_field :password, required: "required", class: "p-4 pt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full" %>
|
||||
</div>
|
||||
<%= form.password_field :password, required: true, label: true %>
|
||||
<%= form.password_field :password_confirmation, required: true, label: true %>
|
||||
|
||||
<div class="relative border border-gray-100 bg-gray-25 rounded-xl focus-within:bg-white focus-within:shadow focus-within:opacity-100">
|
||||
<%= form.label :password_confirmation, class: "p-4 pb-0 block text-sm font-medium text-gray-700" %>
|
||||
<%= form.password_field :password_confirmation, required: "required", class: "p-4 pt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full" %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.submit t(".submit"), class: "flex justify-center w-full px-4 py-3 text-sm font-medium text-white bg-black rounded-xl hover:bg-black focus:outline-none focus:ring-2 focus:ring-gray-200 shadow" %>
|
||||
</div>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
<%
|
||||
header_title t(".title")
|
||||
%>
|
||||
<% header_title t(".title") %>
|
||||
|
||||
<%= styled_form_with url: password_reset_path, class: "space-y-4" do |form| %>
|
||||
<%= form.email_field :email, label: true, autofocus: false, autocomplete: "email", required: "required", placeholder: "you@example.com" %>
|
||||
<% if params[:step] == "pending" %>
|
||||
<p class="text-sm text-gray-500 text-center"><%= t(".requested") %></p>
|
||||
<% else %>
|
||||
<%= styled_form_with url: password_reset_path, class: "space-y-4" do |form| %>
|
||||
<%= form.email_field :email, label: true, autofocus: false, autocomplete: "email", required: "required", placeholder: "you@example.com" %>
|
||||
|
||||
<%= form.submit t(".submit") %>
|
||||
<%= form.submit t(".submit") %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue