diff --git a/.env.development b/.env.development index 7230ecd1..bf526681 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,4 @@ VITE_API_BASE_URL=http://localhost:3000 VITE_CLERK_PUBLISHABLE_KEY=pk_test_b3B0aW1hbC1jaGlja2VuLTU3LmNsZXJrLmFjY291bnRzLmRldiQ +VITE_GOOGLE_REDIRECT_URL=https://optimal-chicken-57.clerk.accounts.dev/v1/oauth_callback VITE_LOG_LEVEL=debug diff --git a/src/onboarding/Login.jsx b/src/onboarding/Login.jsx index c34032ff..32fb94e6 100644 --- a/src/onboarding/Login.jsx +++ b/src/onboarding/Login.jsx @@ -1,4 +1,4 @@ -import { Button, Input } from '@nextui-org/react'; +import { Button, Divider, Image, Input } from '@nextui-org/react'; import { Link, Navigate, useNavigate } from 'react-router-dom'; import { useSignIn, useUser } from '@clerk/clerk-react'; import { reduceState } from '../shared/helpers'; @@ -54,14 +54,13 @@ export default function Login() { } }; - // const handleGoogleLogin = async () => { - // await signIn.authenticateWithRedirect({ - // strategy: 'oauth_google', - // redirectUrl: - // 'https://hip-primate-84.clerk.accounts.dev/v1/oauth_callback', - // redirectUrlComplete: '/' - // }); - // }; + const handleGoogleLogin = async () => { + await signIn.authenticateWithRedirect({ + strategy: 'oauth_google', + redirectUrl: import.meta.env.VITE_GOOGLE_REDIRECT_URL, + redirectUrlComplete: '/' + }); + }; if (isSignedIn) { return ; @@ -78,8 +77,6 @@ export default function Login() {

- {/* */} -
- {/*
- -

or

- -
*/} - {/* */} + {localStorage.getItem('isGoogleOAuthEnabled') && ( +
+ +

or

+ +
+ )} + {localStorage.getItem('isGoogleOAuthEnabled') && ( + + )} */} + {localStorage.getItem('isGoogleOAuthEnabled') && ( + + )}