{"version":3,"file":"static/chunks/pages/index-f2f56d1c0e699417.js","mappings":"uFACKA,OAAOC,SAAWD,OAAOC,UAAY,IAAIC,KAAK,CAC7C,IACA,WACE,OAAO,EAAQ,MACjB,G,kICCS,SAASC,IACtB,MAAM,KAAED,IAASE,EAAAA,EAAAA,cAEX,gBAAEC,EAAe,QAAEC,EAAO,cAAEC,EAAa,aAAEC,IAAiBC,EAAAA,EAAAA,KAelE,OAdAC,EAAAA,EAAAA,YAAU,KACJH,IACED,EACFJ,EAAKS,EAAAA,GAAYC,cAAcC,MACtBR,IAA+B,IAAZC,GAAqBE,EACjDR,OAAOc,SAASC,KAAO,QAAUP,EAAe,MAEhDN,EAAKc,EAAAA,GAAUC,OAEnB,GAGC,CAACZ,EAAiBC,EAASC,IAEvB,IACT,C","sources":["webpack://_N_E/","webpack://_N_E/./src/pages/index.tsx"],"sourcesContent":["\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/\",\n function () {\n return require(\"private-next-pages/index.tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/\"])\n });\n }\n ","import { useEffect } from 'react';\nimport { useRouter } from 'next/router';\nimport useAuth from '../hooks/useAuth';\nimport { PATH_GLOBAL, PATH_AUTH } from '../routes/paths';\n// ----------------------------------------------------------------------\n\nexport default function Index() {\n const { push } = useRouter();\n\n const { isAuthenticated, isAdmin, isInitialized, organization } = useAuth();\n useEffect(() => {\n if (isInitialized) {\n if (isAdmin) {\n push(PATH_GLOBAL.organizations.root);\n } else if (isAuthenticated && isAdmin === false && organization) {\n window.location.href = '/app/' + organization + '/me';\n } else {\n push(PATH_AUTH.login);\n }\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isAuthenticated, isAdmin, isInitialized]);\n\n return null;\n}\n"],"names":["window","__NEXT_P","push","Index","useRouter","isAuthenticated","isAdmin","isInitialized","organization","useAuth","useEffect","PATH_GLOBAL","organizations","root","location","href","PATH_AUTH","login"],"sourceRoot":""}