mirror of https://github.com/rails/rails
Fix the redirect
Need to attempt to resume session to know whether we are authenticated.
This commit is contained in:
parent
c01ee683aa
commit
1dd37e0193
|
@ -3,7 +3,13 @@ class SessionsController < ApplicationController
|
|||
rate_limit to: 10, within: 3.minutes, only: :create, with: -> { redirect_to new_session_url, alert: "Try again later." }
|
||||
|
||||
def new
|
||||
redirect_to root_url if authenticated?
|
||||
resume_session
|
||||
|
||||
if authenticated?
|
||||
redirect_to root_url
|
||||
else
|
||||
render
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
|
|
Loading…
Reference in New Issue