Class: Ecom::Core::ApplicationController

Inherits:
ActionController::API
  • Object
show all
Defined in:
app/controllers/ecom/core/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#current_userObject



10
11
12
13
14
15
# File 'app/controllers/ecom/core/application_controller.rb', line 10

def current_user
  return unless auth_present?

  user = User.find(auth['id'])
  @current_user ||= user if user
end

#logged_in?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'app/controllers/ecom/core/application_controller.rb', line 6

def logged_in?
  !current_user.nil?
end