Skip to content

Commit ca7b317

Browse files
authored
Fix helper behavior on controller that don't require authentication (rails#53175)
* Fix helper behavior on controller that don't require authentication * Removing redundant code, addresses feedback from @zzak
1 parent 00550c7 commit ca7b317

File tree

1 file changed

+2
-2
lines changed
  • railties/lib/rails/generators/rails/authentication/templates/app/controllers/concerns

1 file changed

+2
-2
lines changed

railties/lib/rails/generators/rails/authentication/templates/app/controllers/concerns/authentication.rb.tt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module Authentication
1414

1515
private
1616
def authenticated?
17-
Current.session.present?
17+
resume_session
1818
end
1919

2020
def require_authentication
@@ -23,7 +23,7 @@ module Authentication
2323

2424

2525
def resume_session
26-
Current.session = find_session_by_cookie
26+
Current.session ||= find_session_by_cookie
2727
end
2828

2929
def find_session_by_cookie

0 commit comments

Comments
 (0)