1
0
Fork 0
mirror of https://github.com/omniauth/omniauth.git synced 2022-11-09 12:31:49 -05:00

insert env['SCRIPT_NAME'] before on_failure path

handle sub_uri (a.k.a. BaseURI) at on_failure
This commit is contained in:
Toyokazu Akiyama 2011-12-13 14:54:59 +09:00
parent 2b2384bdf0
commit 9022d66cea
2 changed files with 13 additions and 1 deletions

View file

@ -24,7 +24,7 @@ module OmniAuth
:path_prefix => '/auth',
:on_failure => Proc.new do |env|
message_key = env['omniauth.error.type']
new_path = "#{OmniAuth.config.path_prefix}/failure?message=#{message_key}"
new_path = "#{env['SCRIPT_NAME']}#{OmniAuth.config.path_prefix}/failure?message=#{message_key}"
[302, {'Location' => new_path, 'Content-Type'=> 'text/html'}, []]
end,
:form_css => Form::DEFAULT_CSS,