Thinkmill / keystatic

First class CMS experience, TypeScript API, Markdown & YAML/JSON based, no DB
https://keystatic.com
MIT License
1.25k stars 80 forks source link

astro integration should respect base path #1170

Open stefanprobst opened 5 months ago

stefanprobst commented 5 months ago

when deploying a site with a base path (e.g. www.example.com/my-site), the requests to the /api/keystatic endpoints currently don't take the base path setting into account, i.e. keystatic will try to talk to www.example.com/api/keystatic/github/refresh-token instead of www.example.com/my-site/api/keystatic/github/refresh-token

stefanprobst commented 5 months ago

i think this is coming from here: https://github.com/Thinkmill/keystatic/blob/a1a71c1ab2313c4c0a85fdce3f9a802a14580ece/packages/keystatic/src/app/auth.ts#L59

stefanprobst commented 5 months ago

ok actually, the "no basepath" assumption is everywhere - made it work by patching all the /api/keystatic/* and /keystatic/* links and regexes in @keystatic/core.