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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user