我有一个应用程序,用户可以登录到他们的公司子域.
我用设计.此代码将用户从根域重定向到子域.
def after_sign_in_path_for(resource_or_scope)
scope = Devise::Mapping.find_scope!(resource_or_scope)
subdomain_name = current_user.firm.subdomain
if current_subdomain.nil?
# logout of root domain and login by token to subdomain
token = Devise.friendly_token
current_user.loginable_token = token
current_user.save
sign_out(current_user)
flash[:notice] = nil
home_path = valid_user_url(token, :subdomain => subdomain_name)
return home_path
else
if subdomain_name != current_subdomain.name
# user not part of current_subdomain
sign_out(current_user)
flash[:notice] = nil
flash[:alert] = "Sorry, invalid user or password for subdomain"
end
end
super
end
Run Code Online (Sandbox Code Playgroud)
它在chrome,firefox,opera和safari中运行得非常好,但它在IE9中不起作用.我没有收到任何错误消息.从日志中我看到用户获得了sigend,当用户被重定向到主页时,他/她是未经授权的.有没有人知道发生了什么?形成日志.
Processing by SessionsController#create as HTML
Parameters: {"utf8"=>"?",
"authenticity_token"=>"JaffZi9f+Uyovuya8wR2u7LjG9w/3wdUDqTqONt/kFM=",
"user"=>{"email …Run Code Online (Sandbox Code Playgroud) 在我的rails应用程序中,我正在尝试检查一个字符串(current_user.email)是否等于另一个字符串(@ user.email).我如何使用if/else语句执行此操作?我试过了
<% if @current_user.email(=@user.bio) %>
<a href="google.com"> Link </a>
<% else %>
<% end %>
Run Code Online (Sandbox Code Playgroud)
但是我遇到了语法错误.救命?
我正在尝试创建一个用于Apache Tomcat 6的自签名证书.我可以制作的每个证书都会导致浏览器连接到AES-128.客户希望我证明我可以在AES-256上创建连接.
我试过java的keytool和openssl.我尝试了各种参数,但似乎无法指定密钥大小,只是签名大小.
如何让browser-tomcat连接将AES-256与自签名证书一起使用?