import React, { useEffect } from 'react'; import { Switch, Route } from 'react-router-dom'; import { useAuthorizer } from '@authorizerdev/authorizer-react'; import Dashboard from './pages/dashboard'; import Login from './pages/login'; import ResetPassword from './pages/rest-password'; export default function Root() { const { token, loading, config } = useAuthorizer(); useEffect(() => { if (token && config.redirectURL !== window.location.toString()) { window.location.href = config.redirectURL; } return () => {}; }, [token]); if (loading) { return