Skip to content

Commit 837b679

Browse files
committed
chore: live-demo login rate limit keyed by Cloudflare client IP
1 parent 8067c15 commit 837b679

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎live-demo/app/index.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ new AdminForth({
3333
usersResourceId: 'users', // resource to get user during login
3434
usernameField: 'email', // field where username is stored, should exist in resource
3535
passwordHashField: 'password_hash',
36+
clientIpHeader: 'cf-connecting-ip',
37+
rateLimit: ['20/5m', '100/1h'],
3638
demoCredentials: `${DEMO_EMAIL}:${DEMO_PASSWORD}`, // never use it for production
3739
loginPromptHTML: `Use email <b>${DEMO_EMAIL}</b> and password <b>${DEMO_PASSWORD}</b> to login`,
3840
},

0 commit comments

Comments
 (0)