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

Remove access token from asset url when unnecessary #10548

Merged
merged 20 commits into from
Feb 16, 2022

Conversation

licitdev
Copy link
Member

@licitdev licitdev commented Dec 16, 2021

Closes #10469.

Static access token is automatically appended when an asset is selected.
For the assets to be visible in WYSIWYG, permissions have to be set for the public role or an access token to be provided.

#10054 introduced width and height into the URL params, resulting in the order of access_token changing positions. The different URLs led to two image requests sent, leading to a race condition in image transformation, where the latter request completes with 0 byte file first. The invalid 0 byte file may also be cached by the browser.

Todo

  • Similar refactor of access_token for media upload
  • Rename Image Token to Static Access Token
  • Fix wysiwyg dirty check

@licitdev licitdev marked this pull request as ready for review February 7, 2022 17:03
Copy link
Member

@rijkvanzanten rijkvanzanten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets leave the name imageToken for now, and use it for all image assets. We can rename the label in the options to make more sense. I'd prefer using the old key name in the options over another migration to mess with the options object 👍🏻

@rijkvanzanten rijkvanzanten added this to the v9-next milestone Feb 16, 2022
@rijkvanzanten rijkvanzanten merged commit b3f7bd9 into directus:main Feb 16, 2022
@licitdev licitdev deleted the fix/wysiwyg-access-token branch February 16, 2022 17:00
maltejur added a commit to maltejur/directus that referenced this pull request Mar 20, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Images show as broken once added to wysiwyg editor
2 participants