Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset URLs not registered properly in subdomain sites #219

Open
1 task
kadamwhite opened this issue Oct 31, 2022 · 1 comment
Open
1 task

Asset URLs not registered properly in subdomain sites #219

kadamwhite opened this issue Oct 31, 2022 · 1 comment
Labels
bug Existing functionality isn't behaving as expected

Comments

@kadamwhite
Copy link

kadamwhite commented Oct 31, 2022

Steps to reproduce:

  1. For a multisite network e.g. something.altis.cloud, define a subsite at something.altis.cloud/some/path
  2. Force 2FA on that environment
  3. Observe that no scripts or styles load on the "choose your 2FA provider" form when trying to log in

I expected a functional 2FA form. Instead, we see 404s for all the two-factor plugin scripts and styles, because they get registered as,

https://subdomain.site.altis.cloud/sub/directory/vendor/humanmade/two-factor/assets/js/force-2fa.js

instead of

https://subdomain.site.altis.cloud/vendor/humanmade/two-factor/assets/js/force-2fa.js

The two-factor plugin (both our fork and the upstream copy) use plugins_url( '...blah.js', __FILE__ ) to deduce the URL for the asset. That resolves to full/site/path/vendor... instead of /vendor... when used in an Altis site where the plugin is installed to vendor/humanmade/two-factor.

Acceptance criteria:

  • Scripts and styles are registered with valid URIs
@kadamwhite kadamwhite added the bug Existing functionality isn't behaving as expected label Oct 31, 2022
@kadamwhite
Copy link
Author

Filed upstream in 2FA plugin at WordPress/two-factor#489

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing functionality isn't behaving as expected
Projects
None yet
Development

No branches or pull requests

1 participant