Thinkmill / Thinkmill/keystatic
allow explicitly providing redirect_uri for github sign in
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 159
- Avg merge
- 21h 41m
- Merged PRs (30d)
- 2
Description
when trying to deploy keystatic on our infrastructure, i am running into an issue with the redirect_uri setting for github sign in.
the callback uri in the github app is configured to use the /api/keystatic/github/oauth/callback route on the domain the app is deployed to, however the redirect_uri actually used by keystatic is using a hostname internal to our cluster infra. (in our case, the correct hostname would be only on x-forwarded-host header)
which means i cannot sign in, but instead see this error:
An error occurred when trying to authenticate with GitHub:
The redirect_uri MUST match the registered callback URL for this application.
the redirect_uri query param is constructed here by keystatic:
allowing to set the redirect url explicitly via environment variable would work around this issue i think.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/keystatic/src/api/generic.ts at the redirect_uri construction around lines 375-378, and trace how the GitHub OAuth configuration is read. Add an explicit configuration path for the deployment-provided callback URL, then verify that sign-in sends the configured public URL instead of the internal hostname.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github, typescript
- Domain
- authentication
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100