From 9fa4c010bb2edf2f9eb40bcad8c514dfeb4b546f Mon Sep 17 00:00:00 2001 From: Collins Ikechukwu Date: Thu, 14 Aug 2025 18:24:30 +0100 Subject: [PATCH] feat: update environment configuration and redirect paths for user authentication - Added API and NextAuth configuration to env.example for better setup clarity. - Changed redirect path for authenticated users from '/dashboard' to '/user' in middleware and sign-in logic. - Updated AuthNav component to link to the new '/user' route. - Simplified the Home page by adding a button to navigate to the user dashboard. - Adjusted API base URL reference in the api.ts file for consistency. --- .env.example | 35 ++++++++++ app/auth/signin/page.tsx | 2 +- app/auth/signup/page.tsx | 4 +- app/page.tsx | 102 ++-------------------------- components/auth/AuthNav.tsx | 4 +- components/connect-wallet/index.tsx | 25 +++++++ env.example | 25 ++++++- lib/api/api.ts | 6 +- middleware.ts | 2 +- 9 files changed, 98 insertions(+), 107 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 000000000..9377d2543 --- /dev/null +++ b/.env.example @@ -0,0 +1,35 @@ +NEXT_PUBLIC_STELLAR_NETWORK=testnet + +NEXT_PUBLIC_APP_URL=http://localhost:3000 + +NEXT_PUBLIC_API_URL=https://staging-api.boundlessfi.xyz/api + +NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your_wallet_connect_project_id +# Get this from https://cloud.walletconnect.com/ + +NEXT_PUBLIC_HORIZON_TESTNET_URL=https://horizon-testnet.stellar.org +NEXT_PUBLIC_HORIZON_PUBLIC_URL=https://horizon.stellar.org + +NEXT_PUBLIC_APP_NAME=Boundless +NEXT_PUBLIC_APP_DESCRIPTION=Stellar-based application +NEXT_PUBLIC_APP_ICON=/logo.svg + +NEXT_PUBLIC_DEBUG_MODE=false + +NEXT_PUBLIC_ENABLE_WALLET_CONNECT=true +NEXT_PUBLIC_ENABLE_MULTI_WALLET=true +NEXT_PUBLIC_ENABLE_NETWORK_SWITCHING=true + +NEXTAUTH_SECRET=your_nextauth_secret_here + +NEXTAUTH_URL=http://localhost:3000 + +GOOGLE_CLIENT_ID=your_google_client_id + +GOOGLE_CLIENT_SECRET=your_google_client_secret + +NODE_ENV=development + + + + diff --git a/app/auth/signin/page.tsx b/app/auth/signin/page.tsx index db96a61eb..3b4451a28 100644 --- a/app/auth/signin/page.tsx +++ b/app/auth/signin/page.tsx @@ -73,7 +73,7 @@ export default function SignInPage() { const handleGoogleSignIn = async () => { setIsLoading(true); try { - await signIn('google', { callbackUrl: '/dashboard' }); + await signIn('google', { callbackUrl: '/user' }); } catch { setError('Failed to sign in with Google'); setIsLoading(false); diff --git a/app/auth/signup/page.tsx b/app/auth/signup/page.tsx index e6e83fb7a..b2bbdd00e 100644 --- a/app/auth/signup/page.tsx +++ b/app/auth/signup/page.tsx @@ -261,7 +261,7 @@ export default function SignUpPage() { -
+
@@ -278,7 +278,7 @@ export default function SignUpPage() { window.location.href = '/api/auth/signin/google'; }} disabled={isLoading} - className='w-full' + className='w-full hidden' > - - - } - iconPosition='right' - > - Add comment - - } - /> - - - - - - -
- } - /> - - - - - No recent submissions -
- } - /> - - - - 0 - Approved Submissions - - } - /> - - - - } - bottomText={ -
- 6 grants available -
- } - /> -
- - - - - - - - - - - - + + Go to Dashboard + diff --git a/components/auth/AuthNav.tsx b/components/auth/AuthNav.tsx index 60a4c7f0f..4ec7554dd 100644 --- a/components/auth/AuthNav.tsx +++ b/components/auth/AuthNav.tsx @@ -29,7 +29,7 @@ export function AuthNav() { if (!session) { return (
-