Lorsqu'un utilisateur essaie de se connecter via cette méthode et qu'il échoue. Comment puis-je rediriger vers? Merci d'avance.Rails authenticate_or_request_with_http_basic
class ApplicationController < ActionController::Base
protect_from_forgery
USER_NAME, PASSWORD = "admin", "admin"
helper_method :authenticate
private
def authenticate
begin
authenticate_or_request_with_http_basic do |user_name, password|
user_name == USER_NAME && password == PASSWORD
end
rescue
"HTTP Basic: Access denied"
else
redirect_to root_path
end
end
end
Eh oui, au fond quand il échoue, il va à une page blanche avec un texte. Comment l'obtenir pour revenir à la racine si elle échoue. – RoR
Et le before_filter que j'ai est dans mon admin controller – RoR