我已设计并LdapAuthenticatable
配置为访问OpenLdap
服务器以对用户进行身份验证。
它通常有效,但当服务器关闭时,rescue_from
中的ApplicationController
电话似乎无效。
当我得到
http://localhost:3000/users/sign_in
Rails通过以下方式升级到非托管页面:
在Devise中的Errno :: EHOSTUNREACH :: SessionsController #create 无主机路由 - 连接(2)for" slackdap.nellinux.net"港口389
Rails.root:/ home / archivi / home / src / ruby / rails / tests / rails
应用程序跟踪|框架跟踪|完整追踪 请求
参数:
{" UTF8" = GT;"✓&#34 ;, " authenticity_token" = GT;" mdFadH / 41En8CXizTIu086ouO4BNXrISCmcNLE86LFw =&#34 ;, "用户" = GT; {"电子邮件" = GT;" foo.bar@example.net" ;, "密码" = GT;" [FILTERED]"}, "提交" =>"登录"}
这里,我的ApplicationController:
class ApplicationController < ActionController::Base
rescue_from DeviseLdapAuthenticatable::LdapException do |exception|
render :text => exception, :status => 500
end
protect_from_forgery with: :exception
before_filter :authenticate_user!
include Pundit
rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized
private
def user_not_authorized
flash[:error] = "You are not authorized to perform this action."
redirect_to(request.referrer || root_path)
end
end
有什么建议吗?
由于