From 696b155f556e6ccefe3501760d357220e4570f9b Mon Sep 17 00:00:00 2001 From: Jeffrey Hardy Date: Wed, 4 Sep 2024 13:43:50 -0400 Subject: [PATCH] Use find_signed directly There's no penalty to calling with a nil value. That's why both find_signed and find_signed! exist. Use the latter when you expect a result. --- app/controllers/concerns/authentication.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/concerns/authentication.rb b/app/controllers/concerns/authentication.rb index 0d9ed45a4..ed4da50e4 100644 --- a/app/controllers/concerns/authentication.rb +++ b/app/controllers/concerns/authentication.rb @@ -30,9 +30,7 @@ module Authentication end def find_session_by_cookie - if token = cookies.signed[:session_token] - Session.find_signed(token) - end + Session.find_signed(cookies.signed[:session_token]) end