Module: Mumukit::Login::AuthenticationHelpers

Defined in:
lib/mumukit/login/helpers/authentication_helpers.rb

Instance Method Summary collapse

Instance Method Details

#authenticate!Object



3
4
5
# File 'lib/mumukit/login/helpers/authentication_helpers.rb', line 3

def authenticate!
  .show! unless current_user?
end

#current_userObject



11
12
13
# File 'lib/mumukit/login/helpers/authentication_helpers.rb', line 11

def current_user
  @current_user ||= Mumukit::Platform::User.find_by_uid!(current_user_uid) if current_user?
end

#current_user?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/mumukit/login/helpers/authentication_helpers.rb', line 7

def current_user?
  current_user_uid.present?
end