Skip to content

Commit d140fbd

Browse files
authored
fix: update CSP directives
fix: update CSP directives
2 parents d408e10 + 98466c0 commit d140fbd

File tree

7 files changed

+94
-68
lines changed

7 files changed

+94
-68
lines changed

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18.10.0
1+
v18

apps/discord-bot-frontend/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"prepare": "svelte-kit sync"
1919
},
2020
"dependencies": {
21-
"@auth/core": "^0.28.1",
22-
"@auth/sveltekit": "^0.3.6",
21+
"@auth/core": "^0.37.0",
22+
"@auth/sveltekit": "^1.7.0",
2323
"@aws-crypto/sha256-js": "^2.0.1",
2424
"@carbon/styles": "^1.48.1",
2525
"@discordjs/builders": "^1.1.0",
@@ -45,7 +45,7 @@
4545
"@aws-amplify/discord-bot-tsconfig": "workspace:*",
4646
"@carbon/charts": "^1.5.2",
4747
"@carbon/charts-svelte": "^1.13.25",
48-
"@playwright/test": "^1.37.1",
48+
"@playwright/test": "^1.49.0",
4949
"@sveltejs/adapter-node": "^4.0.1",
5050
"@sveltejs/kit": "^2.5.0",
5151
"@sveltejs/vite-plugin-svelte": "^3.0.2",

apps/discord-bot-frontend/src/app.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ interface AppSession extends Auth.Session {
2121
declare global {
2222
namespace App {
2323
interface Locals {
24+
auth: () => Promise<AppSession | null>
2425
session?: AppSession
2526
// Guild ID of the guild the user is currently viewing
2627
guildId: string
@@ -35,3 +36,5 @@ declare global {
3536
interface Stuff {}
3637
}
3738
}
39+
40+
export type { User, AppSession }

apps/discord-bot-frontend/src/lib/server/hooks/handle-auth.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ import { config } from '$lib/auth/config'
66
* @todo use session callback to extend session?
77
* @todo port in changes to apply roles in discord based on GitHub org membership (if integration is enabled)
88
*/
9-
export const handleAuth = SvelteKitAuth(config) satisfies Handle
9+
const { handle } = SvelteKitAuth(config)
10+
export const handleAuth = handle satisfies Handle

apps/discord-bot-frontend/src/lib/server/hooks/handle-set-session-locals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { Handle } from '@sveltejs/kit'
44
* Hook to set session on event.locals
55
*/
66
export const handleSetSessionLocals: Handle = async ({ event, resolve }) => {
7-
const session = await event.locals.getSession()
7+
const session = await event.locals.auth()
88
if (session) {
99
event.locals.session = session
1010
}

apps/discord-bot-frontend/svelte.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const config = {
2424
'connect-src': ['self', 'https://discord.com'],
2525
'img-src': ['self', 'data:', 'https://cdn.discordapp.com'],
2626
'script-src': ['self'],
27-
'style-src': ['self', 'unsafe-inline'],
27+
'style-src': ['self'],
2828
// https://1.www.s81c.com/ is for Carbon fonts
2929
'font-src': ['self', 'https://1.www.s81c.com/', 'data:'],
3030
},

pnpm-lock.yaml

Lines changed: 83 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)