I'm trying to use clearance with doorkeeper and from the doorkeeper documentation, I have to access the User object like so:
resource_owner_authenticator do
@user = env[:clearance].current_user
unless @user
session[:return_to] = request.fullpath
redirect_to(sign_in_url)
end
@user
end
https://github.com/doorkeeper-gem/doorkeeper/wiki/Authenticating-using-Clearance-or-DIY
but where do I get the env
variable from? Also, I have tried to find the user in session[:current_user]
and session[:user]
but it's not there.
Thanks