🐛 Bug: OAuth provider toggles (GitHub, Google, GitLab) silently fail because IS_*_ENABLED rows are never seeded
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 59.6k
- Forks
- 5.8k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 49
Description
Description
The configure_instance management command uses an all-or-nothing check when seeding OAuth IS_*_ENABLED flags. Because IS_GITEA_ENABLED is already seeded by instance_config_variables in the first loop of the command, the exists() check on line 44 always returns True, and IS_GITHUB_ENABLED, IS_GOOGLE_ENABLED, and IS_GITLAB_ENABLED are never created in the database.
Root cause
keys = ["IS_GOOGLE_ENABLED", "IS_GITHUB_ENABLED", "IS_GITLAB_ENABLED", "IS_GITEA_ENABLED"]
if not InstanceConfiguration.objects.filter(key__in=keys).exists():
# create all four ...
else:
for key in keys:
self.stdout.write(self.style.WARNING(f"{key} configuration already exists"))
IS_GITEA_ENABLED is defined in gitea_config_variables (in instance_config_variables) and gets seeded by the get_or_create loop earlier in handle(). So filter(key__in=keys).exists() is always True, and the else branch runs — printing "already exists" for all four keys even though three of them don't exist.
Consequence
When an admin configures GitHub/Google/GitLab OAuth in God Mode and toggles the provider on:
- The frontend PATCHes
/api/instances/configurations/with{"IS_GITHUB_ENABLED": "1"} - The backend does
InstanceConfiguration.objects.filter(key__in=request.data.keys())which returns an empty queryset (the row doesn't exist) bulk_updateupdates zero rows- The endpoint returns 200 OK with an empty list — no error
- The toggle appears to succeed but reverts on page reload
- The provider never shows up on the login page
Steps to reproduce
- Self-host Plane v1.2.3 (fresh install, no OAuth env vars)
- Go to God Mode → Authentication → GitHub → Configure
- Enter valid GitHub OAuth Client ID and Client Secret, save
- Go back to Authentication page, toggle GitHub on
- Toggle appears to enable but reverts on refresh
- GitHub login button never appears on the login page
Expected behavior
Each IS_*_ENABLED flag should be seeded independently so that the existence of one doesn't prevent creation of the others.
Environment
- Plane version: v1.2.3 (also present on current
previewbranch) - Deployment: Self-hosted Docker Compose
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the configure_instance management command and inspect the OAuth IS_*_ENABLED seeding logic around line 44 and the earlier instance_config_variables loop. Reproduce the fresh-install configuration flow, then verify that each provider flag is stored independently and that enabling a provider persists after refreshing the Authentication page.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100