mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +03:00
ef143978e7
closes https://linear.app/tryghost/issue/ENG-721 ref https://linear.app/tryghost/issue/ENG-708 Comments-UI loads `/ghost/admin-frame/` in an iframe to check if a Staff User is authenticated in order to show moderation options. That iframe request loads a HTML page which in turn contains a script that fires off an API request that attempts to fetch the logged-in user details, resulting in a 403 "error" showing up when not authenticated. In the vast majority of cases there will be no staff user authenticated so lots of extra requests and "errors" are seen unnecessarily. - adjusted the `/ghost/auth-frame/` endpoint to check if the request contains an Admin session cookie - if it does, continue as before with rendering the HTML page so the script is loaded - if it doesn't, return an empty 204 response avoiding the script request and subsequent 403-generating API request - eliminates the 403 error being generated for all typical visitor traffic, the error should only be seen when an Admin was previously logged in but their cookie is no longer valid (either from logging out, or going past the 6month validity period) |
||
---|---|---|
.. | ||
agents | ||
fixtures | ||
mocks | ||
admin-utils.js | ||
api.js | ||
assertions.js | ||
batch-email-utils.js | ||
configUtils.js | ||
db-utils.js | ||
e2e-framework-mock-manager.js | ||
e2e-framework.js | ||
e2e-utils.js | ||
fixture-utils.js | ||
index.js | ||
mocha-retry-reporter.js | ||
overrides.js | ||
redirects.js | ||
stripe-mocker.js | ||
url-service-utils.js | ||
urlUtils.js |