Changes for Rails 3.2 and Clearance 0.16
Hey karmi,
I took the liberty to make some changes to get this much appreciated middleware to work with Rails 3.2 and the newest clearance gem. I removed the current_user override, as it is no longer necessary and made the middleware use clearance_session.sign_in instead of manipulating env directly. Also, the targeting_api? call will take any HTTP Accept-header into consideration, so unauthorized API calls made with just this header will still return 401 instead of redirecting to a sign in page.
I've also taken the liberty to update the FactoryGirl syntax used in tests and made sure the tests pass again.
If you're satisfied with the changes, feel free to pull them in.
Really hoping this pull gets accepted soon :+1:
@jgarth Is this code still relevant for the 1.0.0-rc version of clearance?