Module: Userbin::AuthHelpers

Defined in:
lib/userbin/rails/auth_helpers.rb

Instance Method Summary collapse

Instance Method Details

#authenticate_user!Object



3
4
5
6
7
8
# File 'lib/userbin/rails/auth_helpers.rb', line 3

def authenticate_user!
  unless user_logged_in?
    env['userbin.unauthenticated'] = true
    render nothing: true
  end
end

#current_userObject



10
11
12
# File 'lib/userbin/rails/auth_helpers.rb', line 10

def current_user
  Userbin.current_user
end

#user_logged_in?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/userbin/rails/auth_helpers.rb', line 14

def user_logged_in?
  Userbin.user_logged_in?
end

#user_signed_in?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/userbin/rails/auth_helpers.rb', line 18

def user_signed_in?
  Userbin.user_signed_in?
end