37 lines
1.6 KiB
JavaScript
37 lines
1.6 KiB
JavaScript
import { c as config } from './config-BHx687w1.js';
|
|
import { r as redirect } from './index-Ddp2AB5f.js';
|
|
import './shared-server-i79vVjEm.js';
|
|
|
|
const load = async ({ fetch, cookies }) => {
|
|
if (!cookies.get("token")) {
|
|
return redirect(302, "/auth");
|
|
}
|
|
const res = await fetch(config.api_url + "/me");
|
|
if (res.status > 399 && res.status < 499) {
|
|
cookies.delete("token", {
|
|
path: "/"
|
|
});
|
|
redirect(302, "/auth");
|
|
}
|
|
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;
|
|
const component = async () => component_cache ??= (await import('./_layout.svelte-sO0SWC9M.js')).default;
|
|
const server_id = "src/routes/(app)/+layout.server.js";
|
|
const imports = ["_app/immutable/nodes/2.DO__qnQ5.js","_app/immutable/chunks/scheduler.Nb9dF4RD.js","_app/immutable/chunks/index.aIvb1r_w.js","_app/immutable/chunks/each.DmwFL-7U.js","_app/immutable/chunks/spread.CgU5AtxT.js","_app/immutable/chunks/Icon.Bv1fUSKH.js","_app/immutable/chunks/index.CnPkSA2E.js","_app/immutable/chunks/index.275uym8j.js","_app/immutable/chunks/Toaster.svelte_svelte_type_style_lang.BVlHgIyE.js","_app/immutable/chunks/x.Dp5nscGL.js","_app/immutable/chunks/button.Hx4R_eXH.js","_app/immutable/chunks/mode-watcher.By69KWzR.js","_app/immutable/chunks/config.C93xSGbu.js"];
|
|
const stylesheets = ["_app/immutable/assets/app.D9c6n2ou.css","_app/immutable/assets/Toaster.CZzI-Nh6.css"];
|
|
const fonts = [];
|
|
|
|
export { component, fonts, imports, index, _layout_server as server, server_id, stylesheets };
|
|
//# sourceMappingURL=2-B9yjdAqA.js.map
|