Skip to content

fix: disable oauth2 hooks by default #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

2ynn
Copy link

@2ynn 2ynn commented May 21, 2025

For new SDKs, both oAuth2ClientCredentialsEnabled and auth.oAuth2PasswordEnabled options are set to true by default even though ClientCredentials and Oauth2Password hooks cannot be used simultaneously.

This PR set both to false by default.

Note: I'd suggest we also add a validation error in case both get set to true at the same time to provide a friendlier error message than:

error calling templateOAuth2PasswordSecurityAccessFunction: Error: Multiple OAuth2 Resource Owner Password fields found at templateOAuth2PasswordSecurityAccessFunction (hooks/hooks.ts:178:11(36))

@2ynn 2ynn requested a review from TristanSpeakEasy May 21, 2025 11:35
@bflad
Copy link
Member

bflad commented May 21, 2025

To be honest, I've always been curious why these are generation configuration flags unlike other generator features which are enabled based on licensing and OAS

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.

2 participants