Class: LocalDevise::SessionsController

Inherits:
Devise::SessionsController
  • Object
show all
Defined in:
app/controllers/local_devise/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject


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

def create

  if User.user_exists_but_email_is_unconfirmed?(params[:user][:username])
    set_msg t(:signed_up_but_inactive_html, :scope => 'myinfo.devise.failure', 
                :resend_link => view_context.link_to(t(:resend_confirmation_email_link_text, :scope => 'myinfo.devise.failure'), new_user_confirmation_path))
  else
    self.resource = warden.authenticate!(:scope => resource_name, :recall => "#{controller_path}#failed_login")
    (resource_name, resource)   
    set_msg t(:signed_in, :scope => 'devise.sessions')
    
  end
  respond_to do |format|
    format.js
    # and now keep placeholder integration test happy
    format.html {render :nothing => true, :status => 200, :content_type => 'text/html'}
  end
end

#failed_loginObject


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

def 
  set_msg t(:invalid, :scope => 'devise.failure')   
end