Class: Decidim::Devise::SessionsController
  
  
  
Overview
  
    
Custom Devise SessionsController to avoid namespace problems.
   
 
  
  
    
      Instance Method Summary
      collapse
    
    
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  #check_user_block_status, #check_user_not_blocked
  
  
  
  
  
  
  
  
  
  
    Instance Method Details
    
      
  
  
    #after_sign_out_path_for(user)  ⇒ Object 
  
  
  
  
    
      
39
40
41 
     | 
    
      # File 'app/controllers/decidim/devise/sessions_controller.rb', line 39
def after_sign_out_path_for(user)
  request.referer || super
end 
     | 
  
 
    
      
  
  
    #create  ⇒ Object 
  
  
  
  
    
      
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 
     | 
    
      # File 'app/controllers/decidim/devise/sessions_controller.rb', line 12
def create
  super do |user|
    if user.admin?
                                                            validator = PasswordValidator.new({ attributes: :password })
      user.update!(password_updated_at: nil) unless validator.validate_each(user, :password, sign_in_params[:password])
    end
  end
end
     | 
  
 
    
      
  
  
    #destroy  ⇒ Object 
  
  
  
  
    
      
30
31
32
33
34
35
36
37 
     | 
    
      # File 'app/controllers/decidim/devise/sessions_controller.rb', line 30
def destroy
  current_user.invalidate_all_sessions!
  if params[:translation_suffix].present?
    super { set_flash_message! :notice, params[:translation_suffix], { scope: "decidim.devise.sessions" } }
  else
    super
  end
end
     |