2024-05-29 19:31:10 +00:00
|
|
|
import { c as config } from './config-BHx687w1.js';
|
2024-05-29 18:43:41 +00:00
|
|
|
import { r as redirect } from './index-Ddp2AB5f.js';
|
2024-05-29 19:31:10 +00:00
|
|
|
import './shared-server-i79vVjEm.js';
|
2024-05-29 18:43:41 +00:00
|
|
|
|
|
|
|
const load = async ({ fetch, cookies }) => {
|
|
|
|
if (!cookies.get("token")) {
|
2024-05-29 19:23:04 +00:00
|
|
|
return redirect(302, "/auth");
|
2024-05-29 18:43:41 +00:00
|
|
|
}
|
|
|
|
const res = await fetch(config.api_url + "/me");
|
|
|
|
if (res.status > 399 && res.status < 499) {
|
|
|
|
cookies.delete("token", {
|
|
|
|
path: "/"
|
|
|
|
});
|
2024-05-29 19:23:04 +00:00
|
|
|
redirect(302, "/auth");
|
2024-05-29 18:43:41 +00:00
|
|
|
}
|
|
|
|
const data = await res.json();
|
|
|
|
return {
|
|
|
|
me: data.user
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
var _layout_server = /*#__PURE__*/Object.freeze({
|
|
|
|
__proto__: null,
|
|
|
|
load: load
|
|
|
|
});
|
|
|
|
|
|
|
|
const index = 2;
|
|
|
|
let component_cache;
|
2024-06-13 19:47:09 +00:00
|
|
|
const component = async () => component_cache ??= (await import('./_layout.svelte-EhncOP66.js')).default;
|
2024-05-29 19:16:25 +00:00
|
|
|
const server_id = "src/routes/(app)/+layout.server.js";
|
2024-06-13 19:47:09 +00:00
|
|
|
const imports = ["_app/immutable/nodes/2.yXbsUL8E.js","_app/immutable/chunks/scheduler.7_EeBW2g.js","_app/immutable/chunks/index.BSb_8PJS.js","_app/immutable/chunks/each.BAM8_WyA.js","_app/immutable/chunks/spread.CgU5AtxT.js","_app/immutable/chunks/Icon.DMRWsWs7.js","_app/immutable/chunks/index.BPRz3xFN.js","_app/immutable/chunks/index.CRpkl5Da.js","_app/immutable/chunks/Toaster.svelte_svelte_type_style_lang.BKjag0FG.js","_app/immutable/chunks/x.RsPpi-iV.js","_app/immutable/chunks/button.MHxSUL-o.js","_app/immutable/chunks/mode-watcher.CTjEHy-L.js","_app/immutable/chunks/config.KNWxMNH-.js"];
|
2024-06-10 19:21:30 +00:00
|
|
|
const stylesheets = ["_app/immutable/assets/app.HhLI2UIK.css","_app/immutable/assets/Toaster.CZzI-Nh6.css"];
|
2024-05-29 18:43:41 +00:00
|
|
|
const fonts = [];
|
|
|
|
|
|
|
|
export { component, fonts, imports, index, _layout_server as server, server_id, stylesheets };
|
2024-06-13 19:47:09 +00:00
|
|
|
//# sourceMappingURL=2-CydY8rPn.js.map
|