Hacker News new | ask | show | jobs
by MapleWalnut 1862 days ago
I ran into this issue when setting up UI previews for a GitHub OAuth app.

My solution is to have a single callback server that looks in the OAuth state to determine where to redirect. This isn't secure, so when building the UI, I sign the UI's preview URL with a secret and send that in the OAuth state. The callback server checks the signature and redirects that way.

It's hacky and I wouldn't trust it for a production app, but for a test environment it seems okay.

1 comments

Excellent idea, thanks!