Skip to content
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

fix: make sure AUTH_DISABLE_NEW_USERS is respected when using oauth #573

Merged
merged 3 commits into from
Oct 11, 2024

Conversation

dbarrosop
Copy link
Member

Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Score
Best practice
Introduce a local variable for improved code clarity and maintainability when setting the 'disabled' property

Consider using a constant or configuration variable for the 'disabled' property
value instead of directly accessing ENV.AUTH_DISABLE_NEW_USERS. This approach
improves maintainability and allows for easier testing and configuration changes.

src/routes/oauth/index.ts [335-341]

+const isNewUserDisabled = ENV.AUTH_DISABLE_NEW_USERS;
 user = await insertUser({
   ...userInput,
-  disabled: ENV.AUTH_DISABLE_NEW_USERS,
+  disabled: isNewUserDisabled,
   userProviders: {
     data: [
       {
         providerId: provider,
Suggestion importance[1-10]: 4

Why: The suggestion improves code readability and maintainability by introducing a local variable. However, it's a minor enhancement that doesn't significantly impact functionality or fix any critical issues.

4

@dbarrosop dbarrosop merged commit bbb97d4 into main Oct 11, 2024
10 of 14 checks passed
@dbarrosop dbarrosop deleted the oauth-disable-new-users branch October 11, 2024 10:01
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.

[Auth] disableNewUsers not taken into account when signUp with a social provider
2 participants