jeudi 6 septembre 2018

How to get library of devise so that it can be modified like php libraries.

Getting the generated devise controller like.

class Users::SessionsController < Devise::SessionsController
   before_action :configure_sign_in_params, only: [:create]

  # GET /resource/sign_in
   def new
    # super
        #       byebug
        redirect_to  root_url   
   end

  # POST /resource/sign_in
   def create
        puts 'Login user............'        
        super
        puts '..............'

   end

  # DELETE /resource/sign_out
   def destroy
     super
   end

  # protected

  # If you have extra params to permit, append them to the sanitizer.
   def configure_sign_in_params
     devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
   end
end

where can I get the library of devise so that I can modify it new function and do not get error of double redirect.

Aucun commentaire:

Enregistrer un commentaire