diff options
Diffstat (limited to 'communities/red-right-hand/174bg.net/src/auth.js')
| -rw-r--r-- | communities/red-right-hand/174bg.net/src/auth.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/communities/red-right-hand/174bg.net/src/auth.js b/communities/red-right-hand/174bg.net/src/auth.js new file mode 100644 index 0000000..b6162f0 --- /dev/null +++ b/communities/red-right-hand/174bg.net/src/auth.js @@ -0,0 +1,20 @@ +import { betterAuth } from "better-auth"; +import { Pool } from "pg"; + +const postgresUser = process.env.POSTGRES_USER || "postgres"; +const postgresPassword = process.env.POSTGRES_PASSWORD || "postgres"; +const postgresHost = process.env.POSTGRES_HOST || "postgres"; +const postgresPort = process.env.POSTGRES_PORT || 5432; +const postgresDatabase = process.env.POSTGRES_DB || "postgres"; + +export const auth = betterAuth({ + database: new Pool({ + connectionString: `postgresql://${postgresUser}:${postgresPassword}@${postgresHost}:${postgresPort}/${postgresDatabase}`, + }), + socialProviders: { + discord: { + clientId: process.env.DISCORD_CLIENT_ID, + clientSecret: process.env.DISCORD_CLIENT_SECRET, + }, + }, +}); |
