Class: CzAuth::SessionsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



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

def create
  resource = resource_model.where(email: params[:email]).first
  @authenticated = perform_authentication_for(resource || resource_model)
  respond_to do |format|
    format.html { handle_create_html_response }
    format.json { handle_create_json_response }
  end
end

#destroyObject



22
23
24
25
# File 'app/controllers/cz_auth/sessions_controller.rb', line 22

def destroy
  session[:auth_token] = nil
  redirect_to root_url
end

#newObject



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

def new
  redirect_to root_url and
    return if resource_signed_in?(params[:resource])
  respond_with resource_model.new
end