Browse Source

Fix 404 on session gone

Maarten van den Berg 7 years ago
parent
commit
841821dbc4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/helpers/authentication_helper.rb

+ 1 - 1
app/helpers/authentication_helper.rb

@@ -99,7 +99,7 @@ module AuthenticationHelper
99 99
       @user_session
100 100
     else
101 101
       id = cookies.signed.permanent[:session_id] || session[:session_id]
102
-      @user_session ||= Session.find(id)
102
+      @user_session ||= Session.find_by(id: id)
103 103
     end
104 104
 
105 105
     # Edge case if a session no longer exists in the database