Class: CASClient::SessionsController

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

Direct Known Subclasses

SessionsController

Instance Method Summary collapse

Instance Method Details

#cas_logoutObject



32
33
34
35
36
37
38
# File 'app/controllers/cas_client/sessions_controller.rb', line 32

def cas_logout
  if CASClient::Configuration.mock_cas
    redirect_to 
  else
    render :nothing => true
  end
end

#createObject



18
19
20
# File 'app/controllers/cas_client/sessions_controller.rb', line 18

def create
  raise "Not Implemented"
end

#destroyObject



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

def destroy
  if CASClient::Configuration.mock_cas
    cas_logout
  else
    redirect_url = ::CAS_SERVER["cas_domain"] + '/logout'
    redirect_url << "?url=#{params[:url]}" if params[:url]
    redirect_to redirect_url
  end
end

#newObject



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/cas_client/sessions_controller.rb', line 4

def new
  if CASClient::Configuration.mock_cas
    if request.post?
      request.env['omniauth.auth'] = {}
      request.env['omniauth.auth']['uid'] = params[:uuid]
      create
    else
      render :new
    end
  else
    redirect_to '/auth/cas'
  end
end