@nauth-toolkit/mfa-email 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,4 +4,55 @@ Email one-time code MFA provider for [nauth-toolkit](https://nauth.dev).
|
|
|
4
4
|
|
|
5
5
|
Sends verification codes via email for multi-factor authentication. Requires an email provider (`@nauth-toolkit/email-nodemailer` or `@nauth-toolkit/email-console` for development).
|
|
6
6
|
|
|
7
|
-
**
|
|
7
|
+
**[Documentation](https://nauth.dev/docs/guides/mfa/how-mfa-works)** · **[GitHub](https://github.com/noorixorg/nauth)**
|
|
8
|
+
|
|
9
|
+
> Part of [nauth-toolkit](https://www.npmjs.com/package/@nauth-toolkit/core). Requires `@nauth-toolkit/core` and an email provider.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @nauth-toolkit/mfa-email @nauth-toolkit/email-console
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Enable in your auth config:
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { MFAMethod } from '@nauth-toolkit/core';
|
|
23
|
+
|
|
24
|
+
const authConfig = {
|
|
25
|
+
mfa: {
|
|
26
|
+
enabled: true,
|
|
27
|
+
allowedMethods: [MFAMethod.EMAIL],
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**NestJS** — import the module and it auto-registers:
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { EmailMFAModule } from '@nauth-toolkit/mfa-email/nestjs';
|
|
36
|
+
|
|
37
|
+
@Module({
|
|
38
|
+
imports: [NAuthModule.forRoot(authConfig), EmailMFAModule],
|
|
39
|
+
})
|
|
40
|
+
export class AuthModule {}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Related packages
|
|
46
|
+
|
|
47
|
+
| Package | Purpose |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| [`@nauth-toolkit/email-nodemailer`](https://www.npmjs.com/package/@nauth-toolkit/email-nodemailer) | Nodemailer — production email delivery |
|
|
50
|
+
| [`@nauth-toolkit/email-console`](https://www.npmjs.com/package/@nauth-toolkit/email-console) | Console logging — development use |
|
|
51
|
+
| [`@nauth-toolkit/mfa-totp`](https://www.npmjs.com/package/@nauth-toolkit/mfa-totp) | TOTP authenticator apps |
|
|
52
|
+
| [`@nauth-toolkit/mfa-sms`](https://www.npmjs.com/package/@nauth-toolkit/mfa-sms) | SMS verification codes |
|
|
53
|
+
|
|
54
|
+
See the [full package list](https://www.npmjs.com/package/@nauth-toolkit/core#package-ecosystem) in the core README.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
Free to use. See [license](https://nauth.dev/docs/license).
|