From 6d5e950918a87767b590b60011251e33bd91fab7 Mon Sep 17 00:00:00 2001 From: mohamad Date: Sun, 1 Jun 2025 22:37:44 +0200 Subject: [PATCH] Refactor API routing and update login URLs - Updated the OAuth routes to be included under the main API prefix for better organization. - Changed the Google login URL in the SocialLoginButtons component to reflect the new API structure. These changes aim to improve the clarity and consistency of the API routing and enhance the login flow for users. --- be/app/main.py | 5 ++++- fe/src/components/SocialLoginButtons.vue | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/be/app/main.py b/be/app/main.py index eca992d..3fde609 100644 --- a/be/app/main.py +++ b/be/app/main.py @@ -182,10 +182,13 @@ app.include_router( ) # Include OAuth routes -app.include_router(oauth_router, prefix="/auth", tags=["auth"]) +# app.include_router(oauth_router, prefix="/auth", tags=["auth"]) # Include your API router app.include_router(api_router, prefix=settings.API_PREFIX) + +# Include OAuth routes under the main API prefix +app.include_router(oauth_router, prefix=f"{settings.API_PREFIX}/auth", tags=["auth"]) # --- End Include API Routers --- # Health check endpoint diff --git a/fe/src/components/SocialLoginButtons.vue b/fe/src/components/SocialLoginButtons.vue index 524dc76..3daf209 100644 --- a/fe/src/components/SocialLoginButtons.vue +++ b/fe/src/components/SocialLoginButtons.vue @@ -39,7 +39,7 @@ import { useRouter } from 'vue-router'; const router = useRouter(); const handleGoogleLogin = () => { - window.location.href = '/auth/google/login'; + window.location.href = '/api/v1/auth/google/login'; }; const handleAppleLogin = () => {