Show Google sign-in even when site.json isn't deployed
/api/auth/providers read site.json to build Google's return address, and the deploy copies server/ into /srv/ngu-api without site.json, so it threw and the login page hid the button. Whether Google is on now depends only on the client id and secret; a missing return address is logged when a sign-in starts, naming GOOGLE_REDIRECT_URI and SITE_CONFIG. The docs say how the server is actually deployed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d4b39251d9
commit
e932ee3007
4 changed files with 35 additions and 6 deletions
|
|
@ -53,8 +53,16 @@ and restart. Never commit the secret or paste it into the repo:
|
|||
[Service]
|
||||
Environment=GOOGLE_CLIENT_ID=<client id>
|
||||
Environment=GOOGLE_CLIENT_SECRET=<client secret>
|
||||
Environment=GOOGLE_REDIRECT_URI=https://nextgenerationofunity.org/api/auth/google/callback
|
||||
```
|
||||
|
||||
`GOOGLE_REDIRECT_URI` must match the redirect URI in step 3 exactly.
|
||||
Without it the API builds it from `site.json`'s `url`, which the API only
|
||||
finds if `site.json` is deployed with it and `SITE_CONFIG` points at it
|
||||
(the deploy copies `server/` into `/srv/ngu-api`, and `site.json` lives
|
||||
at the repo root, so it isn't there by default). If neither is set,
|
||||
sign-in fails and the log says so.
|
||||
|
||||
Optional:
|
||||
|
||||
| Variable | Default |
|
||||
|
|
|
|||
|
|
@ -29,8 +29,11 @@ with it off it blocks everything.
|
|||
## Production setup
|
||||
|
||||
1. The API needs to find two files. Both default to the repo layout
|
||||
(`site.json` at the root, the build in `dist/`); set them on the
|
||||
`ngu-api` unit if the deploy puts them elsewhere:
|
||||
(`site.json` at the root, the build in `dist/`), which isn't how the
|
||||
server is deployed: the deploy copies `server/` into `/srv/ngu-api`,
|
||||
so neither file is next to it. Copy `site.json` there with each
|
||||
deploy (eg. rsync it to `/srv/ngu-api/site.json`) and set both on the
|
||||
`ngu-api` unit:
|
||||
|
||||
```ini
|
||||
[Service]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue