Skip to content

Commit 9e4b9a6

Browse files
authored
Merge pull request #53 from AdamVacha/prod-update2
prod-update14
2 parents 617157b + 4092c1f commit 9e4b9a6

4 files changed

Lines changed: 18 additions & 9 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
--health-retries 5
2525
2626
env:
27+
AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
2728
GITHUB_ID: ${{ secrets.GITHUB_ID }}
2829
GITHUB_SECRET: ${{ secrets.GITHUB_SECRET }}
2930
GOOGLE_ID: ${{ secrets.GOOGLE_ID }}

src/auth.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import { SvelteKitAuth } from '@auth/sveltekit';
22
import GitHub from '@auth/sveltekit/providers/github';
33
import Google from '@auth/sveltekit/providers/google';
4+
import {
5+
AUTH_SECRET,
6+
GITHUB_ID,
7+
GITHUB_SECRET,
8+
GOOGLE_ID,
9+
GOOGLE_SECRET
10+
} from '$env/static/private';
411
import { DrizzleAdapter } from '@auth/drizzle-adapter';
512
import {
613
users,
@@ -57,14 +64,14 @@ export const {
5764
},
5865
providers: [
5966
GitHub({
60-
clientId: process.env.GITHUB_ID,
61-
clientSecret: process.env.GITHUB_SECRET
67+
clientId: GITHUB_ID,
68+
clientSecret: GITHUB_SECRET
6269
}),
6370
Google({
64-
clientId: process.env.GOOGLE_ID,
65-
clientSecret: process.env.GOOGLE_SECRET
71+
clientId: GOOGLE_ID,
72+
clientSecret: GOOGLE_SECRET
6673
})
6774
],
6875
trustHost: true,
69-
secret: process.env.AUTH_SECRET
76+
secret: AUTH_SECRET
7077
});

src/lib/server/db.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { drizzle } from 'drizzle-orm/postgres-js';
22
import postgres from 'postgres';
33
import * as schema from '$lib/server/db/schema';
4+
import { DATABASE_URL } from '$env/static/private';
45

5-
const dbUrl = process.env.DATABASE_URL;
6+
const dbUrl = DATABASE_URL;
67

78
if (!dbUrl) throw new Error('DATABASE_URL is required (db-ts)');
89

src/lib/server/db/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { drizzle } from 'drizzle-orm/postgres-js';
22
import postgres from 'postgres';
3+
import { DATABASE_URL } from '$env/static/private';
34

4-
const dburl = process.env.DATABASE_URL;
5-
if (!dburl) throw new Error('DATABASE_URL is required (index.ts)');
5+
if (!DATABASE_URL) throw new Error('DATABASE_URL is required (index.ts)');
66

7-
const client = postgres(dburl);
7+
const client = postgres(DATABASE_URL);
88
export const db = drizzle(client);

0 commit comments

Comments
 (0)