Ghost/apps
Kevin Ansfield ef143978e7
🎨 Reduced requests and 403 responses for comments auth check (#19840)
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)
2024-03-12 12:27:18 +00:00
..
admin-x-demo Update Types packages 2024-01-15 21:04:04 +01:00
admin-x-design-system Update dependency typescript to v5.4.2 2024-03-11 17:16:17 +01:00
admin-x-framework Update dependency typescript to v5.4.2 2024-03-11 17:16:17 +01:00
admin-x-settings Extracted Unsplash Selector from AdminX (#19838) 2024-03-12 11:06:57 +00:00
announcement-bar Update dependency vite to v4.5.2 [SECURITY] 2024-01-22 09:25:09 +01:00
comments-ui 🎨 Reduced requests and 403 responses for comments auth check (#19840) 2024-03-12 12:27:18 +00:00
portal Fixed button spacing in Portal unsubscribe popup footer (#19815) 2024-03-06 14:53:02 +00:00
signup-form Update storybook monorepo to v7.6.17 2024-03-11 17:16:02 +01:00
sodo-search Update dependency vite to v4.5.2 [SECURITY] 2024-01-22 09:25:09 +01:00