Files
developer-roadmap/src/directives/client-authenticated.mjs
T
2023-07-20 19:24:34 +01:00

12 lines
270 B
JavaScript

/**
* @type {import('astro').ClientDirective}
*/
export default async (load, opts) => {
const isAuthenticated =
document.cookie.toString().indexOf('__roadmapsh_jt__') !== -1;
if (isAuthenticated) {
const hydrate = await load();
await hydrate();
}
};