Skip to content

Commit

Permalink
fix csp again & remove console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Feuerhamster committed Aug 14, 2024
1 parent fcd5023 commit b1ae87d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const secret = process.env["CSRF_TOKEN_SECRET"] as string ?? "";
const secretExpires = process.env["CSRF_TOKEN_EXPIRES_IN"] as string ?? "";

const prod = process.env["NODE_ENV"] === "production";
const umamiURL = process.env["UMAMI_SRC"] ? new URL(process.env["UMAMI_SRC"]).host : "";
const umamiURL = process.env["UMAMI_SRC"] ? new URL(process.env["UMAMI_SRC"]).origin : "";
const cspConnectSrc = `connect-src 'self' ${process.env["AXIOS_BASE_URL"]} ${umamiURL}`;

const config = {
Expand All @@ -30,7 +30,7 @@ export const getSession: GetSession = (request) => {
{ expiresIn: secretExpires }
);
}
console.log(config);

return {
csrfToken: csrfToken,
...config
Expand Down
3 changes: 1 addition & 2 deletions src/routes/__layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
let noTrack = ["/manage", "/login"].includes(path) || Boolean(get(token));
if (!noTrack && browser && config.umami_src) {
const res = await umami.track();
console.log(res)
await umami.track();
}
return {
Expand Down
2 changes: 1 addition & 1 deletion svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const config = {
"default-src": ["none"],
"font-src": ["self"],
"img-src": ["self"],
"script-src": ["self", process.env["UMAMI_SRC"] ? new URL(process.env["UMAMI_SRC"]).host : ""],
"script-src": ["self", "https://umami.transdb.de"],
"style-src": ["self", "unsafe-inline"]
} : {}
}
Expand Down

0 comments on commit b1ae87d

Please sign in to comment.