Skip to content

Commit ada4dc0

Browse files
committed
refactor(auth-services):
- fixed env should be service specific - added html packages back to lit-login-server - renamed lit-*-service to lit-*-server - return express instance for devs to customise - pinned @ts-oss/env-cors version This commit has also been tested locally using the E2E test dApp
1 parent b3f63f9 commit ada4dc0

40 files changed

+4779
-12127
lines changed
File renamed without changes.

apps/lit-auth-service/index.ts renamed to apps/lit-auth-server/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const litAuthServer = createLitAuthServer({
77
network: process.env['NETWORK'],
88
litTxsenderRpcUrl: process.env['LIT_TXSENDER_RPC_URL'] as string,
99
litTxsenderPrivateKey: process.env['LIT_TXSENDER_PRIVATE_KEY'],
10-
enableApiKeyGate: true,
10+
enableApiKeyGate: process.env['ENABLE_API_KEY_GATE'] === 'true',
1111
stytchProjectId: process.env['STYTCH_PROJECT_ID'],
1212
stytchSecretKey: process.env['STYTCH_SECRET'],
1313
maxRequestsPerWindow: Number(process.env['MAX_REQUESTS_PER_WINDOW']),

apps/lit-auth-service/package.json renamed to apps/lit-auth-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "lit-auth-service",
2+
"name": "lit-auth-server",
33
"type": "module",
44
"module": "index.ts",
55
"devDependencies": {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

apps/lit-login-service/package.json renamed to apps/lit-login-server/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "lit-login-service",
2+
"name": "lit-login-server",
33
"type": "module",
44
"module": "index.ts",
55
"private": true,
@@ -11,7 +11,6 @@
1111
"@lit-protocol/auth-services": "workspace:*"
1212
},
1313
"devDependencies": {
14-
"@types/bun": "^1.2.15",
1514
"dotenv": "^16.5.0",
1615
"rimraf": "^6.0.1",
1716
"tsx": "^4.19.2"
File renamed without changes.
Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
1-
# ---------- LIT AUTH SERVICE ----------
2-
# supports naga-dev, naga-test, naga
3-
NETWORK=naga-dev
4-
LOG_LEVEL=debug
1+
# Auth Services - Example Environment
2+
# Copy to .env and adjust values as needed.
53

6-
# lit tx sender settings
7-
LIT_TXSENDER_RPC_URL=https://yellowstone-rpc.litprotocol.com
8-
LIT_TXSENDER_PRIVATE_KEY=your_private_key
4+
# --- Auth Server ---
5+
AUTH_SERVER_PORT=3000
6+
AUTH_SERVER_HOST=0.0.0.0
7+
NETWORK=
8+
LIT_TXSENDER_RPC_URL=
9+
LIT_TXSENDER_PRIVATE_KEY=
10+
# "true" to enable the x-api-key gate
11+
ENABLE_API_KEY_GATE=false
12+
REDIS_URL=
13+
STYTCH_PROJECT_ID=
14+
STYTCH_SECRET=
15+
MAX_REQUESTS_PER_WINDOW=60
16+
WINDOW_MS=60000
917

10-
# redis settings
11-
REDIS_URL=redis://xx:[email protected]:12345
12-
PORT=6380
18+
# --- Login Server ---
19+
LOGIN_SERVER_PORT=3300
20+
LOGIN_SERVER_HOST=0.0.0.0
21+
# If omitted, defaults to http://localhost:${LOGIN_SERVER_PORT}
22+
ORIGIN=
23+
STATE_EXPIRY_SECONDS=30
1324

14-
# rate limit settings
15-
ENABLE_API_KEY_GATE=true
16-
MAX_REQUESTS_PER_WINDOW=10
17-
WINDOW_MS=10000
18-
19-
# ---------- LIT LOGIN SERVER ----------
20-
21-
# Google OAuth credentials
22-
GOOGLE_CLIENT_ID=your_google_client_id
23-
GOOGLE_CLIENT_SECRET=your_google_client_secret
24-
25-
# Discord OAuth credentials
26-
DISCORD_CLIENT_ID=your_discord_client_id
27-
DISCORD_CLIENT_SECRET=your_discord_client_secret
28-
29-
# Stytch credentials
30-
STYTCH_PUBLIC_TOKEN=your_stytch_public_token
31-
STYTCH_PROJECT_ID=your_stytch_project_id
32-
STYTCH_SECRET=your_stytch_secret
25+
# Optional social providers
26+
GOOGLE_CLIENT_ID=
27+
GOOGLE_CLIENT_SECRET=
28+
DISCORD_CLIENT_ID=
29+
DISCORD_CLIENT_SECRET=

0 commit comments

Comments
 (0)