I want to override authenticate_user and current_user method of devise gem

Viewed 22077

I want to override authenticate_user! and current_user method of devise gem in my application Controller can you please help me with regards to that Thanks

5 Answers

At application_controller.rb you can overwrite just as you want:

def authenticate_user!
  super # just if want the default behavior 
  call_a_method_to_something if current_user
  # or
  call_a_method_to_something if current_user.nil?
end
Related