fix(web): stop NEXT_PUBLIC_*_AUTH_ENABLED from hiding the provider it names - #1457
Open
Chirag6722 wants to merge 1 commit into
Open
fix(web): stop NEXT_PUBLIC_*_AUTH_ENABLED from hiding the provider it names#1457Chirag6722 wants to merge 1 commit into
Chirag6722 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
Author
|
@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, |
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.
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.)