feat(auth): Implement Google OAuth 2.0 integration with user creation and JWT generation

- Added Google OAuth controller and service to handle authentication via Google.
- Introduced DTOs for Google user and token responses.
- Updated AuthService and UsersService traits to support new Google OAuth functionality.
- Implemented logic to create a new user if they do not exist in the system after Google authentication.
- Enhanced existing user retrieval and JWT generation upon successful login.
- Added tests for Google OAuth flow, including login redirection and callback handling for both new and existing users.
- Updated environment configuration to include Google OAuth credentials.
This commit is contained in:
MythEclipse
2025-08-11 22:31:51 +07:00
parent c6a95c1231
commit cda950ed7e
22 changed files with 1144 additions and 104 deletions
+4
View File
@@ -18,3 +18,7 @@ MINIO_ENDPOINT=http://localhost:9000
MINIO_BUCKET_NAME=default_bucket
MINIO_ACCESS_KEY=your-minio-access-key
MINIO_SECRET_KEY=your-minio-secret-key
GOOGLE_CLIENT_ID="your_google_client_id"
GOOGLE_CLIENT_SECRET="your_google_client_secret"
GOOGLE_REDIRECT_URL="http://127.0.0.1:8080/api/v1/auth/google/callback"