Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authentication fails with bad redirects on any new branches. #94

Open
mbonig opened this issue Nov 17, 2022 · 0 comments
Open

authentication fails with bad redirects on any new branches. #94

mbonig opened this issue Nov 17, 2022 · 0 comments

Comments

@mbonig
Copy link
Contributor

mbonig commented Nov 17, 2022

Auth0 requires an explicit definition of redirect urls during the signin process:

image

However, since every new branch of the docsite produces a new URL for the preview site, both auth0 needs to be updated to allow this redirect URL and the environment variables need to be updated on the preview to tell the site what the URL is that Vercel assigned to it. This makes previewing new builds too painful to set up.

There are three options I see:

  1. Create a new branch called 'preview'. This will be a long-lived release branch alongside 'main'. anytime we want to preview a PR then it would be merged into 'preview'. This means the auth0 and Vercel setup for the 'preview' branch are one-time and static.
    Pros: One-time set up
    Cons: can't easily preview any PR, would have to merge to the 'preview' branch first. Could result in issues related to merging multiple things and adds more branch management work.

  2. Create some hooks in Vercel that will update auth0 and vercel env variables on any new build.
    Pros: any branch is easily previewable without ugly branch management concerns
    Cons: up-front engineering work and a potentially long and ugly list of 'allowed callback urls' in auth0 which could be a pain to maintain properly.

  3. Set up a special read of the environment and if we're in a 'preview' deployment then authentication is skipped all together.
    Pros: probably simple to implement.
    Cons: we remove the ability to test authentication concerns on preview builds.

@mbonig mbonig mentioned this issue Nov 17, 2022
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant