Class: SessionsController

Inherits:
ApplicationController show all
Defined in:
lib/generators/acts_as_tumblr/templates/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



9
10
11
# File 'lib/generators/acts_as_tumblr/templates/sessions_controller.rb', line 9

def create
  render :text => "<pre>"+request.env["omniauth.auth"].to_yaml+"</pre>"
end

#failureObject



13
14
15
# File 'lib/generators/acts_as_tumblr/templates/sessions_controller.rb', line 13

def failure
  render :text => "FAILURE :-("
end

#newObject



2
3
4
5
6
7
# File 'lib/generators/acts_as_tumblr/templates/sessions_controller.rb', line 2

def new
  logger.debug "params: #{params.inspect}"
  services = ['tumblr'] # TODO extract from OmniAuth.config
  links = services.sort.map{|service| "<li style='margin: 15px;'><a href='/auth/#{service}'>#{service}</a></li>" }
  render :text => "Authenticate with: <ul style='font-size: 20pt;'>#{links.join}</ul>", :layout => true
end