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.
This commit is contained in:
Jeffrey Hardy
2024-09-04 13:43:50 -04:00
parent 0613eb73e2
commit 696b155f55
+1 -3
View File
@@ -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