I have two models User and ActiveAdmin on which I want to apply my devise integrations.
I have my custom_failure.rb as follows
class CustomFailure < Devise::FailureApp
def redirect_url
login_path
end
# def redirect_url
# root_path
# end
def respond
if http_auth?
http_auth
else
redirect
end
end
end
Which seems to be working great.
Also, can define in my application controller like :
def after_sign_in_path_for(resource)
# case resource
if resource.is_a?(Admin)
admin_dashboard_path
else
root_path
end
end
and
def after_sign_out_path_for(resource_or_scope)
login_path
end
But the issue is how to use this resource in custom_failure.rb so that I can redirect accordingly to login for user login or for the admin login ?? Acc to current scenario it always redirects to the user login page ??