@vivinkv28/strapi-2fa-admin-plugin 0.1.6 → 0.1.7
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 +0 -61
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -455,67 +455,6 @@ After setup, test these cases:
|
|
|
455
455
|
5. expired OTP restarts the flow properly
|
|
456
456
|
6. wrong email/password still fails safely
|
|
457
457
|
|
|
458
|
-
## Code-Level Overview
|
|
459
|
-
|
|
460
|
-
Main plugin files:
|
|
461
|
-
|
|
462
|
-
```text
|
|
463
|
-
admin/src/index.js
|
|
464
|
-
server/src/index.js
|
|
465
|
-
server/src/routes/index.js
|
|
466
|
-
server/src/controllers/auth.js
|
|
467
|
-
server/src/services/auth.js
|
|
468
|
-
server/src/utils/strapi-session-auth.js
|
|
469
|
-
```
|
|
470
|
-
|
|
471
|
-
Responsibilities:
|
|
472
|
-
|
|
473
|
-
- `admin/src/index.js`
|
|
474
|
-
Minimal admin plugin stub required by the Strapi Plugin SDK.
|
|
475
|
-
|
|
476
|
-
- `server/src/routes/index.js`
|
|
477
|
-
Declares `/login`, `/verify`, and `/resend`.
|
|
478
|
-
|
|
479
|
-
- `server/src/controllers/auth.js`
|
|
480
|
-
Extracts request data, resolves client IP, sets refresh cookies after verification.
|
|
481
|
-
|
|
482
|
-
- `server/src/services/auth.js`
|
|
483
|
-
Core OTP engine: credentials, challenge lifecycle, rate limits, email sending, and session creation.
|
|
484
|
-
|
|
485
|
-
- `server/src/utils/strapi-session-auth.js`
|
|
486
|
-
Resolves Strapi's internal admin session helper at runtime.
|
|
487
|
-
|
|
488
|
-
## Deeper Docs
|
|
489
|
-
|
|
490
|
-
If you want more detail from the repository:
|
|
491
|
-
|
|
492
|
-
- `docs/INTEGRATION.md`
|
|
493
|
-
- `docs/ARCHITECTURE.md`
|
|
494
|
-
- `admin-screen.md`
|
|
495
|
-
|
|
496
|
-
## Development
|
|
497
|
-
|
|
498
|
-
```bash
|
|
499
|
-
npm install
|
|
500
|
-
npm run build
|
|
501
|
-
```
|
|
502
|
-
|
|
503
|
-
Useful commands:
|
|
504
|
-
|
|
505
|
-
- `npm run build`
|
|
506
|
-
- `npm run watch`
|
|
507
|
-
- `npm run watch:link`
|
|
508
|
-
- `npm run verify`
|
|
509
|
-
|
|
510
|
-
## Publishing Checklist
|
|
511
|
-
|
|
512
|
-
1. run `npm install`
|
|
513
|
-
2. run `npm run build`
|
|
514
|
-
3. run `npm run verify`
|
|
515
|
-
4. test in a real Strapi app
|
|
516
|
-
5. bump the version
|
|
517
|
-
6. run `npm publish --access public`
|
|
518
|
-
|
|
519
458
|
## Production Notes
|
|
520
459
|
|
|
521
460
|
- This improves admin security, but email OTP is still weaker than TOTP or WebAuthn.
|