more
This commit is contained in:
@@ -26,6 +26,7 @@ const Login = () => {
|
|||||||
email,
|
email,
|
||||||
password
|
password
|
||||||
);
|
);
|
||||||
|
|
||||||
// Signed in
|
// Signed in
|
||||||
userCredential?.user && navigate("/dashboard");
|
userCredential?.user && navigate("/dashboard");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ import { AuthContext } from "../Context/AuthProvider";
|
|||||||
import { Navigate } from "react-router-dom";
|
import { Navigate } from "react-router-dom";
|
||||||
|
|
||||||
const PrivateRoute = ({ children }) => {
|
const PrivateRoute = ({ children }) => {
|
||||||
|
console.log("AuthContext", AuthContext);
|
||||||
const { currentUserEmail } = useContext(AuthContext);
|
const { currentUserEmail } = useContext(AuthContext);
|
||||||
|
console.log("currentUserEmail", currentUserEmail);
|
||||||
return currentUserEmail === null ? <Navigate to="/" /> : children;
|
return currentUserEmail === null ? <Navigate to="/" /> : children;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ const SignupPage = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function saveUserData(authId, dataValues) {
|
async function saveUserData(authId, dataValues) {
|
||||||
|
console.log("authId, dataValues", authId, dataValues);
|
||||||
const appUserId = uuidv4();
|
const appUserId = uuidv4();
|
||||||
const firmId = uuidv4();
|
const firmId = uuidv4();
|
||||||
const fbAuthUid = authId;
|
const fbAuthUid = authId;
|
||||||
@@ -245,7 +246,6 @@ const SignupPage = () => {
|
|||||||
paymentDataValues,
|
paymentDataValues,
|
||||||
customerDataValues
|
customerDataValues
|
||||||
) {
|
) {
|
||||||
console.log("======>numberOfAccountsToAdd", numberOfAccountsToAdd);
|
|
||||||
const additionalAccounts = numberOfAccountsToAdd
|
const additionalAccounts = numberOfAccountsToAdd
|
||||||
? numberOfAccountsToAdd
|
? numberOfAccountsToAdd
|
||||||
: 0;
|
: 0;
|
||||||
@@ -309,45 +309,24 @@ const SignupPage = () => {
|
|||||||
}
|
}
|
||||||
// ******************** END STRIPE PAY API CALL ******************** //
|
// ******************** END STRIPE PAY API CALL ******************** //
|
||||||
|
|
||||||
const handleSignup = async (totalDue) => {
|
const handleSignup = async () => {
|
||||||
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>handleSignup fired");
|
if (isBusy) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const paymentDataValues = validatePaymentData();
|
const paymentDataValues = validatePaymentData();
|
||||||
if (paymentDataValues === null) {
|
if (paymentDataValues === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* let dataValues = validateUserData();
|
let dataValues = validateUserData();
|
||||||
if (dataValues === null) {
|
if (dataValues === null) {
|
||||||
return;
|
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);
|
const planType = determinePlan(isAnnual, activeRadioOption);
|
||||||
console.log(planType);
|
|
||||||
setIsBusy(true);
|
|
||||||
|
|
||||||
if (paymentDataValues && dataValues) {
|
if (paymentDataValues && dataValues) {
|
||||||
console.log(
|
setIsBusy(true);
|
||||||
"tryblock ~~~ tryblock ~~~ tryblock ~~~ tryblock ~~~ tryblock ~~~ "
|
|
||||||
);
|
|
||||||
try {
|
try {
|
||||||
const userCredential = await createUserWithEmailAndPassword(
|
const userCredential = await createUserWithEmailAndPassword(
|
||||||
auth,
|
auth,
|
||||||
@@ -362,7 +341,10 @@ const SignupPage = () => {
|
|||||||
paymentDataValues,
|
paymentDataValues,
|
||||||
dataValues
|
dataValues
|
||||||
);
|
);
|
||||||
|
console.log(
|
||||||
|
"----------------------------->>>>paymentResponse",
|
||||||
|
paymentResponse
|
||||||
|
);
|
||||||
if (paymentResponse === false) {
|
if (paymentResponse === false) {
|
||||||
setIsBusy(false);
|
setIsBusy(false);
|
||||||
setNotice("Sorry, something went wrong. Please try again.");
|
setNotice("Sorry, something went wrong. Please try again.");
|
||||||
|
|||||||
Reference in New Issue
Block a user