这是我的用户会话控制器创建登录通过的操作
# POST /resource/sign_in
def create
resource = User.find_by_email(params[:user][:email])
# check for inactive
redirect_to(new_user_session_path, :notice => 'Invalid Email Address or Password.') and return if resource.try(:active) == false
# check to see if user is AD user
if ad_resource?(resource)
if !ActiveDirectory.new.authenticate!(params[:user][:email], params[:user][:password])
redirect_to new_user_session_path, :notice => 'Invalid Email Address or Password.'
return
end
else
resource = warden.authenticate!(:scope => resource_name, :recall => "#{controller_path}#new")
end
set_flash_message :notice, :signed_in
sign_in_and_redirect(resource_name, resource)
end
这条线
resource = warden.authenticate!(:scope => resource_name, :recall => "#{controller_path}#new")
那怎么可能登录任何人...我不熟悉设计,我正在尝试登录,我知道数据库中有一个活动用户,但我无法登录并查看warden.authenticate行让我感到困惑,因为它不传递电子邮件和密码...任何帮助都可以帮助我了解身份验证中发生的情况