youtuber-blog-frontend/build/server/chunks/2-DjIX4c9j.js

37 lines
1.6 KiB
JavaScript
Raw Normal View History

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-07 14:10:14 +00:00
const component = async () => component_cache ??= (await import('./_layout.svelte-D5y6O6Mm.js')).default;
2024-05-29 19:16:25 +00:00
const server_id = "src/routes/(app)/+layout.server.js";
2024-06-07 15:34:52 +00:00
const imports = ["_app/immutable/nodes/2.VAWQIre4.js","_app/immutable/chunks/scheduler.ncJpckHt.js","_app/immutable/chunks/index.DNKwBhZH.js","_app/immutable/chunks/each.C-Vm-bAH.js","_app/immutable/chunks/spread.CgU5AtxT.js","_app/immutable/chunks/Icon.B73p7tCT.js","_app/immutable/chunks/index.Bf9t7sah.js","_app/immutable/chunks/index.BHY_2Zs4.js","_app/immutable/chunks/Toaster.svelte_svelte_type_style_lang.C_CyLwr0.js","_app/immutable/chunks/x.IO9lIaqc.js","_app/immutable/chunks/button.Dry7Ezxz.js","_app/immutable/chunks/mode-watcher.BmkPhDyx.js","_app/immutable/chunks/config.pNun6mkT.js"];
2024-05-30 10:31:54 +00:00
const stylesheets = ["_app/immutable/assets/app.DkT83p3n.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-07 15:34:52 +00:00
//# sourceMappingURL=2-DjIX4c9j.js.map