🩹 front: When not logged in using a public link do not redirect to login (#315)
This commit is contained in:
committed by
ericlinagora
parent
75428b9186
commit
14ecf202db
@@ -1,7 +1,6 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
import MenusBodyLayer from '@components/menus/menus-body-layer';
|
import MenusBodyLayer from '@components/menus/menus-body-layer';
|
||||||
import JWTStorage from '@features/auth/jwt-storage-service';
|
|
||||||
import Api from '@features/global/framework/api-service';
|
import Api from '@features/global/framework/api-service';
|
||||||
import Languages from '@features/global/services/languages-service';
|
import Languages from '@features/global/services/languages-service';
|
||||||
import { addApiUrlIfNeeded } from '@features/global/utils/URLUtils';
|
import { addApiUrlIfNeeded } from '@features/global/utils/URLUtils';
|
||||||
@@ -136,12 +135,7 @@ const AccessChecker = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => void setPublicToken(token || ''), []);
|
||||||
(async () => {
|
|
||||||
await setPublicToken(token || '');
|
|
||||||
})();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
|
|
||||||
if ((!details?.item?.id && !loading) || accessGranted === false) {
|
if ((!details?.item?.id && !loading) || accessGranted === false) {
|
||||||
return (
|
return (
|
||||||
@@ -179,5 +173,7 @@ const AccessChecker = ({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!accessGranted)
|
||||||
|
return <></>;
|
||||||
return <>{children}</>;
|
return <>{children}</>;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user