Module: Sinatra::Doorman::Base::Helpers

Defined in:
lib/doorman/base.rb

Instance Method Summary collapse

Instance Method Details

#authenticated?Boolean Also known as: logged_in?

Returns:

  • (Boolean)


43
44
45
# File 'lib/doorman/base.rb', line 43

def authenticated?
  env['warden'].authenticated?
end

#notify(type, message) ⇒ Object



48
49
50
51
# File 'lib/doorman/base.rb', line 48

def notify(type, message)
  message = Messages[message] if message.is_a?(Symbol)
  flash[type] = message if defined?(Rack::Flash)
end


53
54
55
# File 'lib/doorman/base.rb', line 53

def token_link(type, user)
  "http://#{env['HTTP_HOST']}/#{type}/#{user.confirm_token}"
end