Class: Mks::Auth::ApplicationController

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

Instance Method Summary collapse

Instance Method Details

#app_codeObject



23
24
25
# File 'app/controllers/mks/auth/application_controller.rb', line 23

def app_code
  Rails.application.config.app_code
end

#current_userObject



13
14
15
16
17
# File 'app/controllers/mks/auth/application_controller.rb', line 13

def current_user
  return unless auth_present?
  user = User.find(auth['id'])
  @current_user ||= user if user
end

#current_user_idObject



19
20
21
# File 'app/controllers/mks/auth/application_controller.rb', line 19

def current_user_id
  auth['id']
end

#logged_in?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'app/controllers/mks/auth/application_controller.rb', line 9

def logged_in?
  !current_user.nil?
end