fix(web): stop NEXT_PUBLIC_*_AUTH_ENABLED from hiding the provider it names - #1457
fix(web): stop NEXT_PUBLIC_*_AUTH_ENABLED from hiding the provider it names#1457Chirag6722 wants to merge 1 commit into
Conversation
… names The Google and GitHub buttons on the login page were gated on `!process.env.NEXT_PUBLIC_<PROVIDER>_AUTH_ENABLED`, so a self-hosted deployment that set `NEXT_PUBLIC_GOOGLE_AUTH_ENABLED=true` to turn Google on got the opposite: the button disappeared. Rather than dropping the `!` -- which would hide the buttons for every existing self-hoster who never set the flag -- treat the variables as the opt-out switch their current default implies. Unset still shows the provider, any truthy value shows it, and `false`/`0` now genuinely hides it. Only the previously broken case changes behaviour. Both variables are also documented in apps/web/.env.example, where they had no entry. Fixes supermemoryai#1278
|
@Dhravya @MaheshtheDev — first contribution here, so both Actions runs are parked at In the meantime I ran CI's exact steps locally against this branch:
The one thing worth your call is the default, which is why #1278 was filed as an issue rather than a PR: I went with opt-out semantics so no existing self-hosted deployment changes behaviour (unset still shows the provider, |
|
Hi @MaheshtheDev — no problem with this being closed, but could you say what the reason was? There's no note here and I'd like to know for next time. Asking because #1278 is still open and both gates are still inverted on If it was the semantics: #1467 added the AgentID gate as plain opt-in ( If you'd rather not take this from outside the team, that's completely fine — just let me know and I'll leave #1278 alone. |
|
yeah, will share more briefing about it by monday |
Fixes #1278.
The bug
The Google and GitHub buttons on the login page were gated like this:
Because of the
!, a self-hosted deployment that setNEXT_PUBLIC_GOOGLE_AUTH_ENABLED=trueto turn Google on got the opposite result — the button disappeared. Same for GitHub.Why not just drop the
!#1278 deliberately stopped short of a patch, because the two readings imply different defaults and the right one is a product call:
!(opt-in): matches the name, but the buttons vanish for every existing self-hoster who never set the flag. Breaking.truedoes the wrong thing.This PR takes the second reading and makes the implementation honest, so no existing deployment changes behaviour:
truefalse/0Only the previously broken case changes. The flag now never hides the provider it names, and self-hosters get an actual way to turn a provider off, which the old logic couldn't express either.
If you'd rather have true opt-in semantics (unset = hidden), say so and I'll flip it — it's a two-line change to
isSocialProviderEnabled, though it would want a changelog note for self-hosters.Also
Both variables are now in
apps/web/.env.example. #1278 notes the two gating lines were their only references anywhere in the repo — no example entry, no docs.Verification
biome checkpasses on both changed files.tsc --noEmitonapps/web: 84 errors before, 84 after, 0 in the login page. (Those 84 are pre-existing — CI only type-checks@supermemory/ai-sdkand@supermemory/memory-graph, which is the subject ofturbo run check-typesis a no-op — no workspace package implements the script #1249 / fix: make check-types cover all major workspaces #1446.)