!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

201 Members
60 Servers

Load older messages


SenderMessageTime
21 Dec 2023
@lily:lily.flowersLily Fosterbecause uh 👀16:20:35
@peter-lustig:matrix.orgpeter-lustigthe prerendering stuff is so weird16:21:13
@peter-lustig:matrix.orgpeter-lustiglike all of it confuses me16:21:16
@peter-lustig:matrix.orgpeter-lustigi had everything working with dynamic env variables and now nothing of that works anymore16:21:28
@lily:lily.flowersLily Foster

Note that all environment variables referenced in your code should be declared (for example in an .env file), even if they don't have a value until the app is deployed

hmmmmmm (from https://kit.svelte.dev/docs/modules#$env-static-private)

16:21:34
@peter-lustig:matrix.orgpeter-lustig
In reply to @lily:lily.flowers

Note that all environment variables referenced in your code should be declared (for example in an .env file), even if they don't have a value until the app is deployed

hmmmmmm (from https://kit.svelte.dev/docs/modules#$env-static-private)

yep i saw that
16:21:59
@lily:lily.flowersLily Foster
In reply to @peter-lustig:matrix.org
i had everything working with dynamic env variables and now nothing of that works anymore
well i'm worried it's trying to include these vars in client-side generated code. which handing over secrets to the client feels ,,, problematic. would you mind sharing more of the code to help me understand?
16:22:04
@peter-lustig:matrix.orgpeter-lustig
In reply to @lily:lily.flowers
well i'm worried it's trying to include these vars in client-side generated code. which handing over secrets to the client feels ,,, problematic. would you mind sharing more of the code to help me understand?
import { github, google } from '@lucia-auth/oauth/providers';
import {
	GITHUB_CLIENT_ID,
	GITHUB_CLIENT_SECRET,
	GOOGLE_CLIENT_ID,
	GOOGLE_CLIENT_SECRET
} from '$env/static/private';

export const pool = new postgres.Pool({
	host: '/run/postgresql',
	user: 'postgres',
	database: 'app'
});

export const auth = lucia({
	env: dev ? 'DEV' : 'PROD',
	middleware: sveltekit(),
	adapter: pg(pool, {
		user: 'auth_user',
		key: 'user_key',
		session: 'user_session'
	}),
	getUserAttributes: (data) => {
		return {
			username: data.username,
			authProvider: data.auth_provider
		};
	}
});

export const githubAuth = github(auth, {
	clientId: GITHUB_CLIENT_ID,
	clientSecret: GITHUB_CLIENT_SECRET
});
16:23:14
@peter-lustig:matrix.orgpeter-lustigwith $env/dynamic/priavate everything just worked16:23:31
@peter-lustig:matrix.orgpeter-lustigbut in sveltekit 2.0 it does not work anymore16:23:36
@lily:lily.flowersLily Fosterwell apparently prior to 2.0, there was no strong distinction between those types of vars apparently16:24:13
@lily:lily.flowersLily Foster * well apparently prior to 2.0, there was no strong distinction between those types of vars16:24:16
@lily:lily.flowersLily Fosteri'm gonna look up more about how lucia-auth works real quick16:24:39
@lily:lily.flowersLily Foster oh apparently lucia-auth is now just under lucia for v2 16:24:58
@lily:lily.flowersLily Foster * oh apparently lucia-auth is now just under lucia for v2 16:25:05
@lily:lily.flowersLily Fosteroh but other packages are the same. ignore me. i can't read16:25:15
@lily:lily.flowersLily Foster (reading https://lucia-auth.com/migrate/v2/ rn) 16:25:19
@lily:lily.flowersLily Fosterwell that file looks correct according to https://lucia-auth.com/guidebook/github-oauth/sveltekit/#initialize-the-oauth-integration16:26:43
@lily:lily.flowersLily Foster where and how are you using githubAuth? 16:26:48
@peter-lustig:matrix.orgpeter-lustigthis has nothing to do with lucia auth, it is just the static stuff16:27:24
@peter-lustig:matrix.orgpeter-lustigfor the env variables16:27:30
@lily:lily.flowersLily Fosterhmm?16:28:43
@peter-lustig:matrix.orgpeter-lustigi do not get why they made this so confusing once again16:29:12
@peter-lustig:matrix.orgpeter-lustiginstead of writing a proper migration guide16:29:31
@whentze:matrix.orgWanja Hentzeis it really fine to have the github oauth secret in the frontend? 😅16:29:39
@peter-lustig:matrix.orgpeter-lustigfor multiple deployment methods16:29:41
@lily:lily.flowersLily Foster
In reply to @whentze:matrix.org
is it really fine to have the github oauth secret in the frontend? 😅
that's what i'm hoping is not happening. but without more of the code, i can't tell
16:29:52
@peter-lustig:matrix.orgpeter-lustig
In reply to @whentze:matrix.org
is it really fine to have the github oauth secret in the frontend? 😅
that never happens sveltekit errors out when you try to do that
16:29:57
@whentze:matrix.orgWanja Hentzeoh cool16:30:06
@peter-lustig:matrix.orgpeter-lustighttps://kit.svelte.dev/docs/server-only-modules#how-it-works16:31:07

Show newer messages


Back to Room ListRoom Version: 6