Class: LayersOfLondon::Booth::MapTool::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Includes:
Pundit
Defined in:
app/controllers/layers_of_london/booth/map_tool/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#sessionObject

def current_user

byebug
main_app.scope.request.env['warden'].user

end



20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/controllers/layers_of_london/booth/map_tool/application_controller.rb', line 20

def session
  return render json: {} unless current_user.present?

  render json: {
    id: current_user.id,
    email: current_user.email,
    title: current_user.title,
    first_name: current_user.first_name,
    last_name: current_user.last_name,
    role: current_user.role
  }
end