{"version":3,"file":"static/js/883.0678fee0.chunk.js","mappings":"uMAUA,MAsEA,EAtEcA,KACZ,MAAM,YAAEC,EAAW,aAAEC,EAAY,WAAEC,EAAU,MAAEC,IAAUC,EAAAA,EAAAA,MACnD,kBAAEC,EAAiB,gBAAEC,EAAe,uBAAEC,EAAsB,KAAEC,EAAI,MAAEC,IAASC,EAAAA,EAAAA,MAkDnF,OAhDAC,EAAAA,EAAAA,YAAU,KAsCHL,GAAoBN,GAAgBC,GACvCE,IAEFS,QAAQC,IAAI,2BAA4BP,GACxCM,QAAQC,IAAI,sBAAuBX,EAAW,GAE9C,KAIKY,EAAAA,EAAAA,KAACC,EAAAA,EAAM,GAAG,C","sources":["pages/auth/login.tsx"],"sourcesContent":["import { Typography } from \"@mui/material\";\r\nimport Loader from \"components/Loader\";\r\nimport useAuth from \"../../hooks/useAuth\";\r\nimport AuthWrapper from \"../../sections/auth/AuthWrapper\";\r\nimport AuthLogin from \"../../sections/auth/auth-forms/AuthLogin\";\r\nimport logoDark from \"../../assets/images/logo-dark.svg\";\r\nimport { useEffect } from \"react\";\r\nimport { useAuth0 } from \"@auth0/auth0-react\";\r\nimport { setLoggingInStatus, setLogin } from \"store/reducers/login\";\r\nimport { dispatch } from \"store\"\r\nconst Login = () => {\r\n const { isLoggingIn, isLoggingOut, isLoggedIn, login } = useAuth()\r\n const { loginWithRedirect, isAuthenticated, getAccessTokenSilently, user, error} = useAuth0();\r\n\r\n useEffect(() => {\r\n // const login = async () => {\r\n // try {\r\n // console.log(\"Trying to Log In ===>\")\r\n // dispatch(setLoggingInStatus({ isLoggingIn: true }));\r\n // await loginWithRedirect({ \r\n // appState: {\r\n // returnTo: window.location.pathname\r\n // }\r\n // });\r\n // const isLoggedIn = isAuthenticated;\r\n // console.log(\"LoggedIn Successful ===>\", isLoggedIn)\r\n // console.log(\"User ===>\", user)\r\n // console.log(\"Error After LogIn ===>\", error)\r\n // if (isLoggedIn) {\r\n // const token = await getAccessTokenSilently();\r\n // const newState = {\r\n // isLoggedIn: true,\r\n // token,\r\n // user: {\r\n // id: user?.sub,\r\n // avatar: user?.picture,\r\n // email: user?.email,\r\n // name: user?.name,\r\n // tier: \"Premium\",\r\n // },\r\n // };\r\n // dispatch(setLogin(newState));\r\n // dispatch(setLoggingInStatus({ isLoggingIn: false }));\r\n // } else {\r\n // dispatch(setLoggingInStatus({ isLoggingIn: false }));\r\n // }\r\n // } catch (error) {\r\n // console.log(\"error\", error);\r\n // dispatch(setLoggingInStatus({ isLoggingIn: false }));\r\n // }\r\n // };\r\n \r\n if (!isAuthenticated && !isLoggingIn && !isLoggingOut) {\r\n login()\r\n }\r\n console.log(\"isAuthenticated =======>\", isAuthenticated)\r\n console.log(\"isLoggedIn =======>\", isLoggedIn)\r\n\r\n },[])\r\n \r\n\r\n \r\n return \r\n // return (\r\n // \r\n //
\r\n // \"\"\r\n //
\r\n //
\r\n // Welcome back,\r\n // where dreams become a reality.\r\n // \r\n // \r\n // Your platform for prosperity\r\n // \r\n //
\r\n //
\r\n // );\r\n};\r\n\r\nexport default Login;\r\n"],"names":["Login","isLoggingIn","isLoggingOut","isLoggedIn","login","useAuth","loginWithRedirect","isAuthenticated","getAccessTokenSilently","user","error","useAuth0","useEffect","console","log","_jsx","Loader"],"sourceRoot":""}