Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions adminforth/documentation/docs/tutorial/05-ListOfAdapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Original file line number Diff line number Diff line change
@@ -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)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.