How do I get devise to use my custom routes inside of the authenticate_user!
I've declared custom routes in my app for a few of the devise actions, they are as follows:
devise_scope :user do
get 'signup', to: 'devise/registrations#new', as: :signup
get 'login', to: 'devise/sessions#new', as: :login
get 'logout', to: 'devise/sessions#destroy', as: :logout
get 'forgotten', to: 'devise/passwords#new', as: :forgotten
get 'resend-confirmation', to: 'devise/confirmations#new', as: :resendconfirmation
end
However, when an unauthenticated user accesses a protected part of my site still gets redirected to /users/sign_in
. How do I get devise to use my custom routes inside of the authenticate_user!
before_action
? to keep the whole experience of using my app the same.
Thanks all.