Module: Sinatra::Hancock::Users::Helpers

Defined in:
lib/sinatra/hancock/users.rb

Instance Method Summary collapse

Instance Method Details

#signup_emailObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/sinatra/hancock/users.rb', line 17

def 
  <<-HAML
Hello #{@user.first_name},

Thanks for signing up for #{::Hancock::App.provider_name}!  In order to 
complete your registration you will need to click on the following link.

#{@registration_url}

Thanks,
The #{::Hancock::App.provider_name} team
#{absolute_url('/')}
HAML
end

#user_by_token(token) ⇒ Object



10
11
12
13
14
15
# File 'lib/sinatra/hancock/users.rb', line 10

def user_by_token(token)
  user = ::Hancock::User.first(:access_token => token)
  throw(:halt, [400, 'BadRequest']) unless user
  session['hancock_server_user_id'] = user.id
  user
end