chore: profile guard clause

pull/3813/head
Arik Chakma 2 years ago
parent 0185bf179a
commit 1c0eee6929
  1. 13
      src/pages/profile/index.astro

@ -3,8 +3,17 @@ import ProfileDetails from '../../components/Profile/profile-details';
import BaseLayout from '../../layouts/BaseLayout.astro'; import BaseLayout from '../../layouts/BaseLayout.astro';
--- ---
<BaseLayout title="Profile"> <BaseLayout title='Profile'>
<div class="container"> <div class='container'>
<ProfileDetails client:idle /> <ProfileDetails client:idle />
</div> </div>
</BaseLayout> </BaseLayout>
<script>
import Cookies from 'js-cookie';
import { TOKEN_COOKIE_NAME } from '../../lib/utils';
const token = Cookies.get(TOKEN_COOKIE_NAME);
if (!token) {
window.location.href = '/';
}
</script>

Loading…
Cancel
Save