Rack sets SCRIPT_NAME when a path is mapped to an app. So, a rack app built like below will route
all requests starting with /myapp to MyApp and everything else to OtherApp. For an HTTP request
like /myapp/foo/bar the MyApp will see SCRIPT_NAME='/myapp' and PATH_INFO='/foo/bar'.
Rack::Builder.app do
map '/myapp' do
run MyApp
end
run OtherApp
end
The Identity#registration_path and Identity#registration_result methods ignore the script_path
and assume it's always empty-string.
If the identity middleware is mapped to /myapp like above then #registration_path will
return as /auth/identity instead of /myapp/auth/identity. This causes any forms to include
a link to the wrong path and any requests for the correct path to fail the #on_registration_path?
check.
Rack sets SCRIPT_NAME when a path is mapped to an app. So, a rack app built like below will route
all requests starting with
/myappto MyApp and everything else to OtherApp. For an HTTP requestlike
/myapp/foo/barthe MyApp will see SCRIPT_NAME='/myapp' and PATH_INFO='/foo/bar'.The Identity#registration_path and Identity#registration_result methods ignore the script_path
and assume it's always empty-string.
If the identity middleware is mapped to
/myapplike above then#registration_pathwillreturn as
/auth/identityinstead of/myapp/auth/identity. This causes any forms to includea link to the wrong path and any requests for the correct path to fail the
#on_registration_path?check.