refactoring (page): standalone page

This commit is contained in:
Mickael Kerjean
2021-12-22 00:45:33 +11:00
parent bb4365c83f
commit 74a724f61b
3 changed files with 31 additions and 32 deletions

View File

@ -10,10 +10,10 @@ export function HomePage() {
useEffect(() => {
Session.currentUser().then((res) => {
if (res && res.is_authenticated === true) {
setRedirection(res.home ? "/files" + res.home : "/files");
} else {
setRedirection("/login");
setRedirection(res.home ? `/files${res.home}` : "/files");
return;
}
setRedirection("/login");
}).catch((err) => setRedirection("/login"));
}, []);