@nauth-toolkit/mfa-totp 0.2.0 → 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 +51 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,4 +4,54 @@ TOTP authenticator app MFA provider for [nauth-toolkit](https://nauth.dev).
|
|
|
4
4
|
|
|
5
5
|
Adds time-based one-time password (TOTP) support — works with Google Authenticator, Authy, 1Password, and any TOTP-compatible app. Handles secret generation, QR code provisioning URIs, and code verification.
|
|
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`.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @nauth-toolkit/mfa-totp
|
|
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.TOTP],
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**NestJS** — import the module and it auto-registers:
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { TOTPMFAModule } from '@nauth-toolkit/mfa-totp/nestjs';
|
|
36
|
+
|
|
37
|
+
@Module({
|
|
38
|
+
imports: [NAuthModule.forRoot(authConfig), TOTPMFAModule],
|
|
39
|
+
})
|
|
40
|
+
export class AuthModule {}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Related packages
|
|
46
|
+
|
|
47
|
+
| Package | Purpose |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| [`@nauth-toolkit/mfa-sms`](https://www.npmjs.com/package/@nauth-toolkit/mfa-sms) | SMS verification codes |
|
|
50
|
+
| [`@nauth-toolkit/mfa-email`](https://www.npmjs.com/package/@nauth-toolkit/mfa-email) | Email verification codes |
|
|
51
|
+
| [`@nauth-toolkit/mfa-passkey`](https://www.npmjs.com/package/@nauth-toolkit/mfa-passkey) | WebAuthn / passkeys |
|
|
52
|
+
|
|
53
|
+
See the [full package list](https://www.npmjs.com/package/@nauth-toolkit/core#package-ecosystem) in the core README.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
Free to use. See [license](https://nauth.dev/docs/license).
|