Member/Ecology revamp.
This commit is contained in:
parent
fc7ec52574
commit
59d6e97787
31 changed files with 1763 additions and 1010 deletions
12
app/middleware/members-auth.js
Normal file
12
app/middleware/members-auth.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
export default defineNuxtRouteMiddleware(async (to, from) => {
|
||||
if (process.server) return;
|
||||
|
||||
const { memberData, checkMemberStatus } = useAuth();
|
||||
|
||||
if (!memberData.value) {
|
||||
const isAuthenticated = await checkMemberStatus();
|
||||
if (!isAuthenticated) {
|
||||
return navigateTo("/join");
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue