authbackendpackage 1.1.1 β†’ 1.1.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.
Files changed (2) hide show
  1. package/README.md +40 -33
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,13 @@
1
+ Here’s the updated **README** file with the mention of successful testing on your website **PulseTalk**:
2
+
3
+ ---
4
+
1
5
  # πŸ” AuthBackendPackage
2
6
 
3
- A flexible and plug-and-play authentication module for Node.js applications. Provides features such as OTP-based verification, JWT authentication, email verification, password reset, and user profile management.
7
+ A flexible and plug-and-play authentication module for [Node.js](w) applications. Provides features such as [OTP](w)-based verification, [JWT](w) authentication, email verification, password reset, and user profile management.
8
+
9
+ βœ… **Successfully tested and used in production at:**
10
+ πŸ”— [https://pulsetalk-6lrk.onrender.com](https://pulsetalk-6lrk.onrender.com)
4
11
 
5
12
  ---
6
13
 
@@ -37,10 +44,7 @@ const auth = createAuthModule({
37
44
 
38
45
  ## ☁️ Cloudinary Configuration
39
46
 
40
- First, create an account on [Cloudinary](https://cloudinary.com/).
41
- Then, create an API key and place the values in your `.env` file.
42
-
43
- Cloudinary is used for storing profile or other images.
47
+ Create an account on [Cloudinary](https://cloudinary.com/), generate API credentials, and store them in your `.env` file.
44
48
 
45
49
  **Cloudinary Instance:**
46
50
 
@@ -62,11 +66,15 @@ export default cloudinary;
62
66
 
63
67
  ## πŸ” JWT Secret
64
68
 
65
- Choose any secure string as your `JWT_SECRET` and add it to your `.env` file.
69
+ Set a secure `JWT_SECRET` string in your `.env` file.
70
+
71
+ ---
66
72
 
67
73
  ## πŸ“§ Mail Setup
68
74
 
69
- Generate an **App Password** using your Gmail account. Refer to this [guide](https://itsupport.umd.edu/itsupport?id=kb_article_view&sysparm_article=KB0015112) for assistance.
75
+ Generate an **App Password** from your Gmail settings and store it in `.env`.
76
+
77
+ πŸ‘‰ Follow this [Gmail App Password Guide](https://itsupport.umd.edu/itsupport?id=kb_article_view&sysparm_article=KB0015112)
70
78
 
71
79
  ---
72
80
 
@@ -76,23 +84,10 @@ Generate an **App Password** using your Gmail account. Refer to this [guide](htt
76
84
  import mongoose from 'mongoose';
77
85
 
78
86
  const userSchema = new mongoose.Schema({
79
- email: {
80
- type: String,
81
- required: true,
82
- unique: true,
83
- },
84
- name: {
85
- type: String,
86
- required: true,
87
- },
88
- password: {
89
- type: String,
90
- required: true,
91
- },
92
- profilePicture: {
93
- type: String,
94
- default: "",
95
- },
87
+ email: { type: String, required: true, unique: true },
88
+ name: { type: String, required: true },
89
+ password: { type: String, required: true },
90
+ profilePicture: { type: String, default: "" },
96
91
  }, { timestamps: true });
97
92
 
98
93
  const User = mongoose.model('User', userSchema);
@@ -151,13 +146,13 @@ export const protectRoute = async (req, res, next) => {
151
146
 
152
147
  ## 🧠 Features
153
148
 
154
- * βœ… OTP verification via email (SMTP-based)
149
+ * βœ… OTP verification via email (SMTP)
155
150
  * βœ… Signup with verified OTP
156
151
  * βœ… Secure login with JWT
157
- * βœ… Profile update with optional image upload (Cloudinary)
158
- * βœ… Forgot password with bcrypt hashing
159
- * βœ… Logout via cookie expiration
160
- * βœ… Middleware-ready endpoints
152
+ * βœ… Profile update with image support (Cloudinary)
153
+ * βœ… Forgot password with [bcrypt](w)
154
+ * βœ… Cookie-based logout
155
+ * βœ… Middleware-ready routes
161
156
 
162
157
  ---
163
158
 
@@ -165,9 +160,12 @@ export const protectRoute = async (req, res, next) => {
165
160
 
166
161
  ```env
167
162
  MY_MAIL=your-email@gmail.com
168
- MY_PASSWORD=your-email-password-or-app-password
163
+ MY_PASSWORD=your-app-password
169
164
  JWT_SECRET=your-secret-key
170
165
  NODE_ENV=development
166
+ CLOUDINARY_CLOUD_NAME=your-cloud-name
167
+ CLOUDINARY_API_KEY=your-api-key
168
+ CLOUDINARY_API_SECRET=your-api-secret
171
169
  ```
172
170
 
173
171
  ---
@@ -244,14 +242,23 @@ Content-Type: application/json
244
242
 
245
243
  ## πŸ” Cookie-Based JWT Auth
246
244
 
247
- The JWT token is automatically sent via `httpOnly` cookie and expires after 7 days.
245
+ Authentication is done using `httpOnly` cookies which automatically expire after 7 days for enhanced security.
246
+
247
+ ---
248
+
249
+ ## πŸš€ Live Usage Demo
250
+
251
+ βœ… **Successfully running on:**
252
+ 🌐 [https://pulsetalk-6lrk.onrender.com](https://pulsetalk-6lrk.onrender.com)
248
253
 
249
254
  ---
250
255
 
251
256
  ## πŸ“„ License
252
257
 
253
- Apache-2.0
258
+ Licensed under [Apache-2.0](w).
254
259
 
255
260
  ---
256
261
 
257
- Built with ❀️ by the Shreyash Team
262
+ Built with ❀️ by the **Shreyash Team**
263
+
264
+ ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authbackendpackage",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "npm run test"