Skip to content

fix: read loginmethod#5805

Merged
yau-wd merged 10 commits intomainfrom
fix/loginmethod
Feb 24, 2026
Merged

fix: read loginmethod#5805
yau-wd merged 10 commits intomainfrom
fix/loginmethod

Conversation

@0xi4o
Copy link
Copy Markdown
Contributor

@0xi4o 0xi4o commented Feb 20, 2026

No description provided.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @0xi4o, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the security and usability of the login method management system. It introduces stricter access controls, prevents sensitive client secrets from being exposed during read operations, and improves the update and testing workflows for SSO configurations by intelligently handling secret values. The changes also refine the user interface to better reflect the state of configured secrets.

Highlights

  • Security Enhancements for Login Methods: Implemented robust organization ID validation for reading login methods, ensuring users can only access configurations belonging to their active organization.
  • Client Secret Redaction and Preservation: Client secrets are now redacted (replaced with '********') when login method configurations are read, preventing their exposure. Additionally, the update logic for login methods has been improved to preserve existing client secrets if a placeholder is submitted, avoiding accidental overwrites.
  • SSO Configuration UI Improvement: The SSO configuration page in the UI now displays '********' for client secret fields when a secret is already configured, providing a better user experience and indicating that a secret exists without revealing its value.
  • Permission Control for Login Method Access: Added a 'sso:manage' permission check to the GET /loginmethod endpoint, restricting access to login method configurations to authorized users.
  • Improved Test Configuration Handling: The test configuration endpoint for SSO providers now intelligently retrieves and uses existing client secrets if a placeholder is provided in the test request, streamlining the testing process for already configured methods.
Changelog
  • packages/server/src/enterprise/controllers/login-method.controller.ts
    • Added constructor to bind 'this' context for controller methods.
    • Implemented user's active organization ID validation for 'read' operations.
    • Filtered out 'clientSecret' from login method configurations when returned by the 'read' method.
    • Enhanced 'testConfig' method to retrieve and use existing 'clientSecret' if a placeholder is provided in the request.
    • Ensured 'queryRunner' is properly released in the 'testConfig' method's finally block.
  • packages/server/src/enterprise/routes/login-method.route.ts
    • Applied 'sso:manage' permission check to the GET /loginmethod route.
  • packages/server/src/enterprise/services/login-method.service.ts
    • Modified the update logic to retain the existing 'clientSecret' if the incoming configuration contains a placeholder for it.
  • packages/server/src/utils/constants.ts
    • Updated 'WHITELIST_URLS' to specifically whitelist '/api/v1/loginmethod/default' instead of the broader '/api/v1/loginmethod'.
  • packages/ui/src/views/auth/ssoConfig.jsx
    • Introduced a 'PLACEHOLDER_SECRET' constant for displaying redacted secrets.
    • Updated UI logic to display '********' for client secret fields if a secret is configured but not explicitly provided in the API response for Azure, Google, Auth0, and GitHub SSO.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces important security enhancements for SSO configuration. It adds permission checks, prevents client secrets from being exposed to the frontend, and correctly handles updates to preserve existing secrets. My review focuses on improving code maintainability by reducing duplication and refactoring repetitive code blocks. I've identified a few areas where the code can be made more modular and easier to maintain.

@0xi4o 0xi4o marked this pull request as ready for review February 20, 2026 14:05
@yau-wd yau-wd self-requested a review February 23, 2026 09:42
Copy link
Copy Markdown
Contributor

@yau-wd yau-wd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required fix, screenshots shared in Jira

@0xi4o
Copy link
Copy Markdown
Contributor Author

0xi4o commented Feb 23, 2026

@yau-wd Yep. I was able to replicate it and I've now pushed a fix.

@0xi4o 0xi4o requested a review from yau-wd February 23, 2026 10:49
@yau-wd yau-wd merged commit c22f2d3 into main Feb 24, 2026
8 checks passed
@yau-wd yau-wd deleted the fix/loginmethod branch February 24, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants