auth-verify 1.2.1 → 1.2.3
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/assets/banner.png +0 -0
- package/package.json +4 -2
- package/readme.md +3 -3
- package/src/jwt/index.js +2 -2
|
Binary file
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"uuid": "^13.0.0"
|
|
13
13
|
},
|
|
14
14
|
"name": "auth-verify",
|
|
15
|
-
"version": "1.2.
|
|
15
|
+
"version": "1.2.3",
|
|
16
16
|
"description": "A simple Node.js library for sending and verifying OTP via email",
|
|
17
17
|
"main": "index.js",
|
|
18
18
|
"scripts": {
|
|
@@ -38,7 +38,9 @@
|
|
|
38
38
|
"2fa",
|
|
39
39
|
"email",
|
|
40
40
|
"jwt",
|
|
41
|
-
"oauth"
|
|
41
|
+
"oauth",
|
|
42
|
+
"redis",
|
|
43
|
+
"cookie"
|
|
42
44
|
],
|
|
43
45
|
"author": "Jahongir Sobirov",
|
|
44
46
|
"license": "MIT",
|
package/readme.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
- ✅ Sending OTPs via Email, SMS (pluggable helpers), and Telegram bot
|
|
6
6
|
- ✅ JWT creation, verification and optional token revocation with memory/Redis storage
|
|
7
7
|
- ✅ Session management (in-memory or Redis)
|
|
8
|
-
- ✅ New: OAuth 2.0 integration for Google, Facebook, GitHub,
|
|
8
|
+
- ✅ New: OAuth 2.0 integration for Google, Facebook, GitHub, X (Twitter) and Linkedin
|
|
9
9
|
- ⚙️ Developer extensibility: custom senders and `auth.register.sender()` / `auth.use(name).send(...)`
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -23,11 +23,11 @@ npm install auth-verify
|
|
|
23
23
|
|
|
24
24
|
## ⚙️ Quick overview
|
|
25
25
|
|
|
26
|
-
- `AuthVerify` (entry): constructs and exposes `.jwt`, `.otp`,
|
|
26
|
+
- `AuthVerify` (entry): constructs and exposes `.jwt`, `.otp`, (optionally) `.session` and `.oauth` managers.
|
|
27
27
|
- `JWTManager`: sign, verify, decode, revoke tokens. Supports `storeTokens: "memory" | "redis" | "none"`.
|
|
28
28
|
- `OTPManager`: generate, store, send, verify, resend OTPs. Supports `storeTokens: "memory" | "redis" | "none"`. Supports email, SMS helper, Telegram bot, and custom dev senders.
|
|
29
29
|
- `SessionManager`: simple session creation/verification/destroy with memory or Redis backend.
|
|
30
|
-
- `OAuthManager`: Handle OAuth 2.0 logins for Google, Facebook, GitHub, X
|
|
30
|
+
- `OAuthManager`: Handle OAuth 2.0 logins for Google, Facebook, GitHub, X and Linkedin
|
|
31
31
|
---
|
|
32
32
|
|
|
33
33
|
## 🚀 Example: Initialize library (CommonJS)
|
package/src/jwt/index.js
CHANGED
|
@@ -248,8 +248,8 @@ const CookieManager = require("./cookie");
|
|
|
248
248
|
|
|
249
249
|
class JWTManager {
|
|
250
250
|
constructor(secret, options = {}) {
|
|
251
|
-
if (!secret) throw new Error("JWT secret is required");
|
|
252
|
-
this.secret = secret;
|
|
251
|
+
// if (!secret) throw new Error("JWT secret is required");
|
|
252
|
+
this.secret = secret || "JWT_AUTH_VERIFY_SECRET";
|
|
253
253
|
this.storeType = options.storeTokens || "none";
|
|
254
254
|
|
|
255
255
|
if (this.storeType === "memory") {
|