if you are using devise gems in rails, Please replace this function:
def find_verified_user # this checks whether a user is authenticated with devise
if verified_user = env['warden'].user
verified_user
else
reject_unauthorized_connection
end
end
I hope this will help you.