ci: inject OAuth client ids and flags into the frontend build#237
Merged
Conversation
The login/signup buttons never appeared on staging because the frontend bundle is built on the CI runner, where the gitignored frontend/.env is absent, and the OAuth VUE_APP_* vars were not mapped from secrets like the Firebase ones. Map the three providers enable-flags and client ids from GitHub secrets, and pin the constant github.com / gitlab.com OAuth base URLs, so the shipped bundle actually shows and wires the buttons. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the βοΈ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
β¨ Finishing Touchesπ§ͺ Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
The Google/GitHub/GitLab buttons never appeared on staging even though they work locally. Reason: the frontend bundle is built on the GitHub Actions runner (the
validatejob runsnpm run build, then the artifact is shipped to the VPS).frontend/.envis gitignored, so on the runner the onlyVUE_APP_*values are the ones explicitly mapped from secrets in the build step β and the OAuth vars were missing from that map. So the shipped bundle had everyVUE_APP_IS_*_LOGINflagundefinedβ no buttons. Editingfrontend/.envon the server has no effect, because the server never builds the bundle.Fix
Map the OAuth enable-flags and client ids from GitHub secrets in the build step (same pattern as the Firebase vars), and pin the constant
github.com/gitlab.comOAuth base URLs.Settings β Secrets and variables β Actions β New repository secret:
VUE_APP_IS_GOOGLE_LOGINtrueVUE_APP_GOOGLE_CLIENT_IDVUE_APP_IS_GITHUB_LOGINtrueVUE_APP_GITHUB_CLIENT_IDVUE_APP_IS_GITLAB_LOGINtrueVUE_APP_GITLAB_CLIENT_IDNote: the OAuth apps must also list the staging origin/redirect (
https://staging-app.alianhub.com). GitHub OAuth Apps allow only one callback URL, so staging likely needs its own GitHub app (separate client id) β Google/GitLab can add staging as an extra redirect on the same app.After the secrets are set, trigger a redeploy (Actions β Run workflow, enabled by #236) to rebuild with them.
π€ Generated with Claude Code