Class: SessionsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



13
14
15
16
17
# File 'app/controllers/sessions_controller.rb', line 13

def create
  env['warden'].authenticate(:cartodb_oauth)

  redirect_back_or_default root_path
end

#destroyObject



19
20
21
22
# File 'app/controllers/sessions_controller.rb', line 19

def destroy
  logout
  redirect_to root_path
end

#newObject



7
8
9
10
11
# File 'app/controllers/sessions_controller.rb', line 7

def new
  if logged_in?
    redirect_to features_path and return
  end
end

#unauthenticatedObject



24
25
26
27
28
29
30
# File 'app/controllers/sessions_controller.rb', line 24

def unauthenticated
  respond_to do |format|
    format.html do
      render :action => 'new' and return
    end
  end
end