Skip to content

Refactor User Authentication Strategies #15

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

Merged
merged 4 commits into from
Nov 9, 2024

Conversation

foyzulkarim
Copy link
Owner

  • Updated githubStrategy.js and googleStrategy.js to ensure consistent handling of user data and improved error handling.
  • Restructured user payloads in both strategies to match the new schema, ensuring that GitHub and Google specific data are correctly nested.
  • Added a new function getByGoogleId in service.js to retrieve users by their Google ID, enhancing the service layer's functionality.
  • Improved the user creation and update logic to maintain consistency across different authentication methods.
  • Enhanced logging for better traceability of user actions and errors.

- Updated `githubStrategy.js` and `googleStrategy.js` to ensure consistent handling of user data and improved error handling.
- Restructured user payloads in both strategies to match the new schema, ensuring that GitHub and Google specific data are correctly nested.
- Added a new function `getByGoogleId` in `service.js` to retrieve users by their Google ID, enhancing the service layer's functionality.
- Improved the user creation and update logic to maintain consistency across different authentication methods.
- Enhanced logging for better traceability of user actions and errors.
@foyzulkarim foyzulkarim marked this pull request as ready for review November 9, 2024 08:55
- Extract duplicated authentication callback logic into reusable function
- Create handleAuthCallback helper that works for both GitHub and Google strategies
- Reduce code duplication while maintaining existing functionality
- Keep strategy-specific logging for GitHub callbacks
Copy link

sonarqubecloud bot commented Nov 9, 2024

@foyzulkarim foyzulkarim changed the title **Refactor User Authentication Strategies** Refactor User Authentication Strategies Nov 9, 2024
@foyzulkarim foyzulkarim merged commit 4839dba into main Nov 9, 2024
2 checks passed
@foyzulkarim foyzulkarim deleted the feature/refactor-auth-and-add-google-login branch November 9, 2024 09:02
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.

1 participant