You've already forked obsidian-visualiser
Fix useContent not using cookies therefore skipping the auth step
This commit is contained in:
@@ -2,9 +2,13 @@ import { hasPermissions } from "#shared/auth.util";
|
||||
|
||||
export default defineNuxtRouteMiddleware(async (to, from) => {
|
||||
const { loggedIn, fetch, user } = useUserSession();
|
||||
const { fetch: fetchContent } = useContent();
|
||||
const meta = to.meta;
|
||||
|
||||
await fetch();
|
||||
if(await fetch())
|
||||
{
|
||||
fetchContent(true);
|
||||
}
|
||||
|
||||
if(!!meta.guestsGoesTo && !loggedIn.value)
|
||||
{
|
||||
@@ -34,8 +38,5 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
|
||||
}
|
||||
}
|
||||
|
||||
const { fetch: fetchContent } = useContent();
|
||||
await fetchContent(false);
|
||||
|
||||
return;
|
||||
});
|
||||
Reference in New Issue
Block a user