Skip to content

Commit 51113a2

Browse files
committed
add captcha plugin
1 parent fefdf74 commit 51113a2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

live-demo/app/resources/users.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import AdminForth, { AdminForthDataTypes, AdminForthResourceColumn } from 'adminforth';
22
import ForeignInlineListPlugin from '@adminforth/foreign-inline-list';
33
import { randomUUID } from 'crypto';
4+
import CaptchaAdapterCloudflare from '../../../adapters/adminforth-login-captcha-adapter-cloudflare/index.js';
5+
import CaptchaPlugin from '../../../plugins/adminforth-login-captcha/index.js';
46

57
const blockDemoUsers = async ({ record, adminUser, resource }) => {
68
if (adminUser.dbUser && adminUser.dbUser.role !== 'superadmin') {
@@ -26,6 +28,12 @@ export default {
2628
new ForeignInlineListPlugin({
2729
foreignResourceId: 'audit_logs',
2830
}),
31+
new CaptchaPlugin({
32+
captchaAdapter: new CaptchaAdapterCloudflare({
33+
siteKey: "0x4AAAAAACy5qrUGxw0KU3KI", // Replace with your site key
34+
secretKey: "0x4AAAAAACy5qvlONDC41YGD9XCwRl9xHD0", // Replace with your secret key
35+
}),
36+
}),
2937
],
3038
columns: [
3139
{

0 commit comments

Comments
 (0)