+
+
+

+
+
+ {/*
*/}
+
+
+
+
+ Log in as a:
+
+
+
+
+
+
+
+
+
+ Don't have an account?{" "}
+
+ Sign Up
+
+
+
+
+
+
+
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/components/AuthPages/Login/index2.jsx b/src/components/AuthPages/Login/index2.jsx
index 68f4bd2..2703c97 100644
--- a/src/components/AuthPages/Login/index2.jsx
+++ b/src/components/AuthPages/Login/index2.jsx
@@ -33,7 +33,7 @@ export default function Login() {
const [validCaptcha, setValidCaptcha] = useState({ show: false, valid: "" }); // FOR CAPTCHA
- let [loginType, setLoginType] = useState("");
+ let [loginType, setLoginType] = useState('');
const [loginLoading, setLoginLoading] = useState(false);
@@ -199,43 +199,43 @@ export default function Login() {
// document.cookie ="loginType=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
// }, []);
- useLayoutEffect(() => {
- // checks the cookie in order to set the login type before components mounts
- // if(document.cookie.includes("loginType=family")){
- // setLoginType('family')
- // }else if(document.cookie.includes("loginType=full")){
- // setLoginType('full')
- // }else{
- // setLoginType('full')
- // }
- function readCookie(cname) {
- // checks the cookie in order to set the login type before components mounts
- let name = cname + "=";
- let decoded_cookie = decodeURIComponent(document.cookie);
- let carr = decoded_cookie.split(";");
- for (let i = 0; i < carr.length; i++) {
- let c = carr[i];
- while (c.charAt(0) == " ") {
- c = c.substring(1);
- }
- if (c.indexOf(name) == 0) {
- return c.substring(name.length, c.length);
- }
- }
- return "full";
+ useEffect(()=>{
+ if(state && state.loginType){
+ setLoginType(state.loginType)
+ }else{
+ navigate('/login', {replace: true})
}
- let loginValue = readCookie("loginType");
- setLoginType(loginValue);
+ },[])
- if (state?.error) {
- //check if the login path has an error state indicating any social handle login with error
- setMsgError("Unexpected Error, Please try again soon.");
- setTimeout(() => {
- setMsgError("");
- navigate("/login", { replace: true });
- }, 4000);
- }
- }, []);
+ // useLayoutEffect(() => {
+ // function readCookie(cname) {
+ // // checks the cookie in order to set the login type before components mounts
+ // let name = cname + "=";
+ // let decoded_cookie = decodeURIComponent(document.cookie);
+ // let carr = decoded_cookie.split(";");
+ // for (let i = 0; i < carr.length; i++) {
+ // let c = carr[i];
+ // while (c.charAt(0) == " ") {
+ // c = c.substring(1);
+ // }
+ // if (c.indexOf(name) == 0) {
+ // return c.substring(name.length, c.length);
+ // }
+ // }
+ // return "full";
+ // }
+ // let loginValue = readCookie("loginType");
+ // setLoginType(loginValue);
+
+ // if (state?.error) {
+ // //check if the login path has an error state indicating any social handle login with error
+ // setMsgError("Unexpected Error, Please try again soon.");
+ // setTimeout(() => {
+ // setMsgError("");
+ // navigate("/login", { replace: true });
+ // }, 4000);
+ // }
+ // }, []);
useEffect(() => {
setMail("");
@@ -273,7 +273,7 @@ export default function Login() {
{/* HIDES THIS IF USER SESSION HAS EXPIRED */}
{sessionExpired != "true" && (
-
+
{/*
Sign In to WrenchBoard
*/}
@@ -299,7 +299,7 @@ export default function Login() {
)}
{/* switch login component */}
-
+