Skip to content

Commit

Permalink
feat: throttler
Browse files Browse the repository at this point in the history
  • Loading branch information
rharkor committed Jul 28, 2023
1 parent 5a73746 commit 55798da
Show file tree
Hide file tree
Showing 7 changed files with 281 additions and 18 deletions.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ NEXTAUTH_SECRET=PGJwbCE+WiJILGZ+K1ZqU24mIX5tVH0=
GITHUB_CLIENT_ID=secret
GITHUB_CLIENT_SECRET=secret
AUTH_ADMIN_EMAIL=secret
AUTH_ADMIN_PASSWORD=secret
AUTH_ADMIN_PASSWORD=secret
REDIS_HOST=localhost
REDIS_USERNAME=
REDIS_PASSWORD=
REDIS_PORT=6379
11 changes: 11 additions & 0 deletions env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ export const env = createEnv({
GITHUB_CLIENT_SECRET: z.string().nonempty(),
AUTH_ADMIN_EMAIL: z.string().nonempty(),
AUTH_ADMIN_PASSWORD: z.string().nonempty(),
REDIS_HOST: z.string().nonempty(),
REDIS_PORT: z
.string()
.nonempty()
.transform((value) => parseInt(value)),
REDIS_USERNAME: z.string().optional(),
REDIS_PASSWORD: z.string().optional(),
},
client: {},
runtimeEnv: {
Expand All @@ -29,6 +36,10 @@ export const env = createEnv({
GITHUB_CLIENT_SECRET: process.env.GITHUB_CLIENT_SECRET,
AUTH_ADMIN_EMAIL: process.env.AUTH_ADMIN_EMAIL,
AUTH_ADMIN_PASSWORD: process.env.AUTH_ADMIN_PASSWORD,
REDIS_HOST: process.env.REDIS_HOST,
REDIS_PORT: process.env.REDIS_PORT,
REDIS_USERNAME: process.env.REDIS_USERNAME,
REDIS_PASSWORD: process.env.REDIS_PASSWORD,
},
onValidationError: (error) => {
console.error(error)
Expand Down
Loading

0 comments on commit 55798da

Please sign in to comment.