From e84e581d018a04c707ace950590e6bf33123ba2d Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Mon, 29 Jan 2024 20:12:31 -0600 Subject: [PATCH] more --- src/Components/Login/Login.js | 1 + src/Components/PrivateRoute.js | 2 ++ src/Components/SignupPage/SignupPage.js | 40 +++++++------------------ 3 files changed, 14 insertions(+), 29 deletions(-) diff --git a/src/Components/Login/Login.js b/src/Components/Login/Login.js index fca31c7..9a290e0 100644 --- a/src/Components/Login/Login.js +++ b/src/Components/Login/Login.js @@ -26,6 +26,7 @@ const Login = () => { email, password ); + // Signed in userCredential?.user && navigate("/dashboard"); } catch (error) { diff --git a/src/Components/PrivateRoute.js b/src/Components/PrivateRoute.js index b4275ca..956040f 100644 --- a/src/Components/PrivateRoute.js +++ b/src/Components/PrivateRoute.js @@ -3,7 +3,9 @@ import { AuthContext } from "../Context/AuthProvider"; import { Navigate } from "react-router-dom"; const PrivateRoute = ({ children }) => { + console.log("AuthContext", AuthContext); const { currentUserEmail } = useContext(AuthContext); + console.log("currentUserEmail", currentUserEmail); return currentUserEmail === null ? : children; }; diff --git a/src/Components/SignupPage/SignupPage.js b/src/Components/SignupPage/SignupPage.js index cac677b..38d49bc 100644 --- a/src/Components/SignupPage/SignupPage.js +++ b/src/Components/SignupPage/SignupPage.js @@ -147,6 +147,7 @@ const SignupPage = () => { } async function saveUserData(authId, dataValues) { + console.log("authId, dataValues", authId, dataValues); const appUserId = uuidv4(); const firmId = uuidv4(); const fbAuthUid = authId; @@ -245,7 +246,6 @@ const SignupPage = () => { paymentDataValues, customerDataValues ) { - console.log("======>numberOfAccountsToAdd", numberOfAccountsToAdd); const additionalAccounts = numberOfAccountsToAdd ? numberOfAccountsToAdd : 0; @@ -309,45 +309,24 @@ const SignupPage = () => { } // ******************** END STRIPE PAY API CALL ******************** // - const handleSignup = async (totalDue) => { - console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>handleSignup fired"); - + const handleSignup = async () => { + if (isBusy) { + return; + } const paymentDataValues = validatePaymentData(); if (paymentDataValues === null) { return; } - /* let dataValues = validateUserData(); + let dataValues = validateUserData(); if (dataValues === null) { return; } - */ - const id = uuidv4(); - const email = `${id}@jim.com`; - let dataValues = { - firstName: "fffff", - lastName: "ffff", - firm: "form", - telephone: "(313) 333-3333", - streetAddress: "123 main", - city: "new york", - state: "New York", - zipCode: "10122", - barNumber: "2343434", - practiceArea: "3df", - email: email, - password: "stingPrug1", - confirmPassword: "stingPrug1", - }; const planType = determinePlan(isAnnual, activeRadioOption); - console.log(planType); - setIsBusy(true); if (paymentDataValues && dataValues) { - console.log( - "tryblock ~~~ tryblock ~~~ tryblock ~~~ tryblock ~~~ tryblock ~~~ " - ); + setIsBusy(true); try { const userCredential = await createUserWithEmailAndPassword( auth, @@ -362,7 +341,10 @@ const SignupPage = () => { paymentDataValues, dataValues ); - + console.log( + "----------------------------->>>>paymentResponse", + paymentResponse + ); if (paymentResponse === false) { setIsBusy(false); setNotice("Sorry, something went wrong. Please try again.");