diff --git a/adminforth/documentation/docs/tutorial/05-ListOfAdapters.md b/adminforth/documentation/docs/tutorial/05-ListOfAdapters.md index 4b3abd30..d2123b3e 100644 --- a/adminforth/documentation/docs/tutorial/05-ListOfAdapters.md +++ b/adminforth/documentation/docs/tutorial/05-ListOfAdapters.md @@ -186,3 +186,24 @@ Pros: * Simplest in use - does not reqauire any external daemon. Cones: * In production sutable for single-process installations only + + +## 🤖Captcha adapters + +Used to add capthca to the login screen + +[🔗Captcha adapter source class](https://github.com/devforth/adminforth/blob/65153408a119314dad339f452700e0937952034a/adminforth/types/adapters/CaptchaAdapter.ts#L5) + +### Cloudflare adapter + +``` +npm i @adminforth/login-captcha-adapter-cloudflare +``` + + +### reCaptcha adapter + +``` +npm i @adminforth/login-captcha-adapter-recaptcha +``` + diff --git a/adminforth/documentation/docs/tutorial/07-Plugins/19-login-captcha.md b/adminforth/documentation/docs/tutorial/07-Plugins/19-login-captcha.md new file mode 100644 index 00000000..eb553614 --- /dev/null +++ b/adminforth/documentation/docs/tutorial/07-Plugins/19-login-captcha.md @@ -0,0 +1,45 @@ +# Login Captcha + +This plugin provides a captcha for the login page to enhance security. + +## Installation + +To install the plugin, run the following command: + +```bash +npm i @adminforth/login-captcha +``` + +You will also need to install a captcha adapter. For example, to use the Cloudflare adapter, run: + +```bash +npm i @adminforth/login-captcha-adapter-cloudflare +``` + +## Usage + +To use the plugin, add it to your user resource file. Here's an example: + +```ts template="./resources/adminuser.ts" +// Import the plugin and adapter +import CaptchaPlugin from "@adminforth/login-captcha"; +import CaptchaAdapterCloudflare from "@adminforth/captcha-adapter-cloudflare"; + +... + +// Add the plugin to the `plugins` array +plugins: [ + new CaptchaPlugin({ + captchaAdapter: new CaptchaAdapterCloudflare({ + siteKey: "YOUR_SITE_KEY", // Replace with your site key + secretKey: "YOUR_SECRET_KEY", // Replace with your secret key + }), + }), +] +``` + +## Result + +After setting up the plugin, your login page will include a captcha. Below is an example of how it will look: + +![Login Captcha Example](LoginCaptcha1.png) \ No newline at end of file diff --git a/adminforth/documentation/docs/tutorial/07-Plugins/LoginCaptcha1.png b/adminforth/documentation/docs/tutorial/07-Plugins/LoginCaptcha1.png new file mode 100644 index 00000000..22c48a52 Binary files /dev/null and b/adminforth/documentation/docs/tutorial/07-Plugins/LoginCaptcha1.png differ