Skip to content

bug(oauth): custom OAuth show_button=false is ignored and always saved as true #39381

@Shreyas2004wagh

Description

@Shreyas2004wagh

Description:

Custom OAuth show_button cannot be reliably set to false during provider initialization.
When _show_button=false is provided, the setting is still persisted as true, so the login button remains visible.

Steps to reproduce:

  1. Set environment variables for a custom OAuth provider, for example:
    • Accounts_OAuth_Custom_Github=true
    • Accounts_OAuth_Custom_Github_show_button=false
  2. Start Rocket.Chat.
  3. Open Administration > Settings > OAuth > Custom OAuth: Github and check show_button value.
  4. Check login page provider visibility.

Expected behavior:

If Accounts_OAuth_Custom_<Provider>_show_button=false is set, the provider login button should be hidden (show_button=false persisted).

Actual behavior:

show_button is persisted as true, so the provider login button is still shown.

Server Setup Information:

  • Version of Rocket.Chat Server: 8.3.0-develop
  • License Type: N/A
  • Number of Users: N/A
  • Operating System: N/A
  • Deployment Method: docker/env-based setup
  • Number of Running Instances: N/A
  • DB Replicaset Oplog: N/A
  • NodeJS Version: N/A
  • MongoDB Version: N/A

Client Setup Information

  • Desktop App or Browser Version: Any
  • Operating System: Any

Additional context

Code path involved:

  • apps/meteor/server/lib/oauth/initCustomOAuthServices.ts passes showButton from env.
  • apps/meteor/server/lib/oauth/addOAuthService.ts uses values.showButton || true for Accounts_OAuth_Custom-<name>-show_button, which converts explicit false to true.

Relevant logs:

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions