The current Google OAuth flow had some issues with error handling and user creation. This pull request aims to improve the flow by adding robust error handling and creating a new user if they don't exist. This will improve the overall user experience and security of the application.
How Has This Been Tested?
I have tested the changes by running the following tests:
Tested the Google OAuth flow with a valid ID token and authorization code
Tested the Google OAuth flow with an invalid ID token and authorization code
Tested the creation of a new user during the OAuth flow
Tested the generation of access and refresh tokens for the user
Tested the setting of refresh token cookie with secure and httponly flags
Screenshots (if appropriate - Postman, etc):
Types of changes
[X] Bug fix (non-breaking change which fixes an issue)
[X] New feature (non-breaking change which adds functionality)
[X] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[X] My code follows the code style of this project.
[X] My change requires a change to the documentation.
Description
This pull request improves the Google OAuth flow by adding enhanced error handling and user creation. The changes include:
Related Issue (Link to issue ticket)
https://github.com/hngprojects/hng_boilerplate_nestjs/issues/884
Motivation and Context
The current Google OAuth flow had some issues with error handling and user creation. This pull request aims to improve the flow by adding robust error handling and creating a new user if they don't exist. This will improve the overall user experience and security of the application.
How Has This Been Tested?
I have tested the changes by running the following tests:
Screenshots (if appropriate - Postman, etc):
Types of changes
Checklist: