fix logout
This commit is contained in:
@@ -14,7 +14,7 @@ class PasswordResetsController < ApplicationController
|
||||
reset_password_sent_at: Time.current
|
||||
)
|
||||
PasswordResetMailer.reset(@user).deliver_later
|
||||
else
|
||||
elsif @user.present?
|
||||
@user.invite_by!
|
||||
InvitationMailer.invite(@user).deliver_later
|
||||
end
|
||||
|
||||
@@ -9,9 +9,6 @@ class SessionsController < ApplicationController
|
||||
end
|
||||
|
||||
def create
|
||||
# Skip authentication if rate limited
|
||||
return if @rate_limited
|
||||
|
||||
user = User.find_by(email: params[:email]&.downcase&.strip)
|
||||
|
||||
if user&.authenticate(params[:password])
|
||||
@@ -50,6 +47,6 @@ class SessionsController < ApplicationController
|
||||
current_user&.forget_me if cookies.signed[:remember_token]
|
||||
reset_session
|
||||
cookies.delete(:remember_token)
|
||||
redirect_to root_path, notice: "You have been logged out."
|
||||
redirect_to root_path, notice: "You have been logged out.", status: :see_other
|
||||
end
|
||||
end
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<% if admin? %>
|
||||
<%= link_to "Admin", admin_root_path, class: "bg-indigo-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-indigo-700 transition" %>
|
||||
<% end %>
|
||||
<%= link_to "Sign Out", logout_path, data: { turbo_method: :delete, turbo: false },
|
||||
<%= link_to "Sign Out", logout_path, data: { turbo_method: :delete },
|
||||
class: "text-sm font-medium text-slate-600 hover:text-red-600 transition" %>
|
||||
</div>
|
||||
<% else %>
|
||||
@@ -74,8 +74,8 @@
|
||||
<% if admin? %>
|
||||
<%= link_to "Admin", admin_root_path, class: "px-2 py-2 text-sm font-medium text-indigo-700 hover:bg-indigo-50 rounded transition" %>
|
||||
<% end %>
|
||||
<%= link_to "Sign Out", logout_path, data: { turbo_method: :delete, turbo: false },
|
||||
class: "px-2 py-2 text-sm font-medium text-red-600 hover:bg-red-50 rounded transition" %>
|
||||
<%= link_to "Sign Out", logout_path, data: { turbo_method: :delete },
|
||||
class: "block px-2 py-2 text-sm font-medium text-red-600 hover:bg-red-50 rounded transition" %>
|
||||
<% else %>
|
||||
<%= link_to "Sign In", login_path, class: "px-2 py-2 text-sm font-medium text-indigo-700 hover:bg-indigo-50 rounded transition" %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user