current_user nil while using omniauth with clearance

249 Views Asked by At

This is my sessions controller

class SessionsController <  Clearance::SessionsController
  include ActionView::Layouts
  include ActionController::Flash

  def create
    user = AdminUser.find_or_create_from_auth_hash(request.env['omniauth.auth'])
    sign_in(user)
    redirect_to admin_dashboard_index_path
  end
end

for some reason my current_user is nil when redirected to admin_dashboard_index_path. I have require_login in all other controllers. So the AD login gets into an indefinite loop. Am I missing any configuration ? All my other controllers are inherting from AdminController which inherits from ActionController::Base

0

There are 0 best solutions below