chore: internal pages guard

pull/3813/head
Arik Chakma 2 years ago
parent f8c4023d9a
commit 580ee114c9
  1. 10
      src/pages/settings/change-password.astro
  2. 10
      src/pages/settings/profile.astro

@ -9,3 +9,13 @@ import SettingLayout from '../../layouts/SettingLayout.astro';
<ChangePasswordForm client:load />
</SettingSidebar>
</SettingLayout>
<script>
import Cookies from 'js-cookie';
import { TOKEN_COOKIE_NAME } from '../../lib/constants';
const token = Cookies.get(TOKEN_COOKIE_NAME);
if (!token) {
window.location.href = '/';
}
</script>

@ -9,3 +9,13 @@ import SettingLayout from '../../layouts/SettingLayout.astro';
<UpdateProfileForm client:load />
</SettingSidebar>
</SettingLayout>
<script>
import Cookies from 'js-cookie';
import { TOKEN_COOKIE_NAME } from '../../lib/constants';
const token = Cookies.get(TOKEN_COOKIE_NAME);
if (!token) {
window.location.href = '/';
}
</script>

Loading…
Cancel
Save