Fix getting host

This commit is contained in:
Lakhan Samani
2022-01-31 14:30:13 +05:30
parent 4e48320cf1
commit 36d9861517
4 changed files with 11 additions and 8 deletions

View File

@@ -9,9 +9,11 @@ const Dashboard = lazy(() => import('./pages/dashboard'));
export default function Root() {
const { token, loading, config } = useAuthorizer();
console.log(config);
useEffect(() => {
if (token) {
const url = new URL(config.redirectURL || '/app');
console.log('=> url', url);
if (url.origin !== window.location.origin) {
window.location.href = config.redirectURL || '/app';
}