diff --git a/apps/svelte.dev/package.json b/apps/svelte.dev/package.json index 692ce2005d..b4e74b2999 100644 --- a/apps/svelte.dev/package.json +++ b/apps/svelte.dev/package.json @@ -48,7 +48,6 @@ "cookie": "^0.6.0", "d3-geo": "^3.1.0", "d3-geo-projection": "^4.0.0", - "devalue": "^5.0.0", "do-not-zip": "^1.0.0", "flexsearch": "^0.7.43", "flru": "^1.0.2", diff --git a/apps/svelte.dev/src/routes/(authed)/+layout.svelte b/apps/svelte.dev/src/routes/(authed)/+layout.svelte index 6379d6925c..7b91ed29fb 100644 --- a/apps/svelte.dev/src/routes/(authed)/+layout.svelte +++ b/apps/svelte.dev/src/routes/(authed)/+layout.svelte @@ -1,20 +1,19 @@ - `, + ``, { headers: { 'Set-Cookie': cookie.serialize('sid', sessionid, { diff --git a/apps/svelte.dev/src/routes/auth/login/+server.js b/apps/svelte.dev/src/routes/auth/login/+server.js index f2f00d6854..bef18c7dfe 100644 --- a/apps/svelte.dev/src/routes/auth/login/+server.js +++ b/apps/svelte.dev/src/routes/auth/login/+server.js @@ -1,33 +1,33 @@ import { redirect } from '@sveltejs/kit'; -import { client_id, oauth } from '../_config.js'; +import { oauth } from '../_config.js'; +import { GITHUB_CLIENT_ID } from '$env/static/private'; -export const GET = client_id - ? /** @param {{url: URL}} opts */ ({ url }) => { - const Location = - `${oauth}/authorize?` + - new URLSearchParams({ - scope: 'read:user', - client_id, - redirect_uri: `${url.origin}/auth/callback` - }).toString(); - - redirect(302, Location); - } - : () => - new Response( - ` -
-In order to use GitHub authentication, you will need to register an OAuth application and create a local .env file:
-GITHUB_CLIENT_ID=[YOUR_APP_ID]\nGITHUB_CLIENT_SECRET=[YOUR_APP_SECRET]\nBASEURL=http://localhost:5173-
The BASEURL
variable should match the callback URL specified for your app.
See also here
- - `, - { - status: 500, - headers: { - 'Content-Type': 'text/html; charset=utf-8' - } +export function GET({ url }) { + if (!GITHUB_CLIENT_ID) { + return new Response( + ` + +In order to use GitHub authentication, you will need to register an OAuth application and create a local .env file:
+GITHUB_CLIENT_ID=[YOUR_APP_ID]\nGITHUB_CLIENT_SECRET=[YOUR_APP_SECRET]\nBASEURL=http://localhost:5173+
The BASEURL
variable should match the callback URL specified for your app.
See also here
+ + `, + { + status: 500, + headers: { + 'Content-Type': 'text/html; charset=utf-8' } - ); + } + ); + } + + const params = new URLSearchParams({ + scope: 'read:user', + client_id: GITHUB_CLIENT_ID, + redirect_uri: `${url.origin}/auth/callback` + }); + + redirect(302, `${oauth}/authorize?${params}`); +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ced5b0e6d5..bb20346f5f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -110,9 +110,6 @@ importers: d3-geo-projection: specifier: ^4.0.0 version: 4.0.0 - devalue: - specifier: ^5.0.0 - version: 5.0.0 do-not-zip: specifier: ^1.0.0 version: 1.0.0