{"_id":"@coconut-packages/um-middlewares","_rev":"3-388ab3a1a62c6bb83e3e1f9066dde4ad","name":"@coconut-packages/um-middlewares","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@coconut-packages/um-middlewares","version":"0.0.1","keywords":[],"author":"","license":"ISC","_id":"@coconut-packages/um-middlewares@0.0.1","maintainers":[{"name":"namankhater","email":"naman22khater@gmail.com"}],"dist":{"shasum":"259b22ea2f53592bc2f415efdb343b49a4d5f332","tarball":"https://registry.npmjs.org/@coconut-packages/um-middlewares/-/um-middlewares-0.0.1.tgz","fileCount":3,"integrity":"sha512-vDdkrCD+B1JgAxVbBIStmPCKrtG/Qhn+bQf/VdJItvQE3HHZXAvj3wtKr+CR79ax4JX/XIfPB6a9shvjt38zfg==","signatures":[{"sig":"MEYCIQDgyZKfPq5IAxIFhPDau4c+t9I5kP/7k/2Cim3oLugtOAIhANNSpaZMoxnZnidqC6B8EFKdsPE708ByikTrs7w3VFuV","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2802},"main":"index.js","gitHead":"6ad67dd2f80c1af589c8ecc8f96cde4f7a245684","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"namankhater","actor":{"name":"namankhater","type":"user","email":"naman22khater@gmail.com"},"email":"naman22khater@gmail.com"},"_npmVersion":"10.9.2","description":"/**\r  * Middleware to authenticate JWT tokens in incoming HTTP requests.\r  *\r  * Extracts the Bearer token from the `Authorization` header, verifies its validity,\r  * and attaches the corresponding user object to the request if authentication succeeds.\r  ","directories":{},"_nodeVersion":"22.16.0","dependencies":{"@coconut-packages/um-models":"latest","@coconut-packages/jsonwebtoken":"^1.1.1","@coconut-packages/standard-response":"latest"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/um-middlewares_0.0.1_1750707998856_0.4198028503831428","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@coconut-packages/um-middlewares","version":"0.0.2","keywords":[],"author":"","license":"ISC","_id":"@coconut-packages/um-middlewares@0.0.2","maintainers":[{"name":"namankhater","email":"naman22khater@gmail.com"}],"dist":{"shasum":"4587cd673ee88fce12844c95636a33c6905c1f01","tarball":"https://registry.npmjs.org/@coconut-packages/um-middlewares/-/um-middlewares-0.0.2.tgz","fileCount":3,"integrity":"sha512-TXktw/jVGGM3lE7rp7oeWdByh7o2+MUK8jk7aqlzAw2SYz8paWz1AtkP/gspGUicXnEk+k6S1MZSG7mNX7TJtg==","signatures":[{"sig":"MEUCIGKy1Ynlkuro8Bc9VzuXxmU/PD0dhzYxqVgIFYI1CkzEAiEAzuX07j1K0Te4lnsRus6OFSeLwOvzz66oUoEUzhdABUk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2826},"main":"index.js","gitHead":"d24968b60aa7238f7f9f209301cec1f3dda85d7c","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"namankhater","email":"naman22khater@gmail.com"},"_npmVersion":"10.9.2","description":"/**\r  * Middleware to authenticate JWT tokens in incoming HTTP requests.\r  *\r  * Extracts the Bearer token from the `Authorization` header, verifies its validity,\r  * and attaches the corresponding user object to the request if authentication succeeds.\r  ","directories":{},"_nodeVersion":"22.16.0","dependencies":{"@coconut-packages/um-models":"latest","@coconut-packages/jsonwebtoken":"^1.1.1","@coconut-packages/standard-response":"latest"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/um-middlewares_0.0.2_1755286521326_0.5556866272776093","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@coconut-packages/um-middlewares","version":"0.0.3","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":"","license":"ISC","description":"/**\r  * Middleware to authenticate JWT tokens in incoming HTTP requests.\r  *\r  * Extracts the Bearer token from the `Authorization` header, verifies its validity,\r  * and attaches the corresponding user object to the request if authentication succeeds.\r  ","dependencies":{"@coconut-packages/jsonwebtoken":"^1.1.1","@coconut-packages/standard-response":"latest","@coconut-packages/um-models":"latest"},"_id":"@coconut-packages/um-middlewares@0.0.3","gitHead":"bf74f4009c412ac8a02b7e0c9c8306c0e4205802","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-451IZGSpD5HxGJP9KiCIGHz0I5cbK4fqgTKxDSThUR/FJV247FWBgSjK0dQamJAXo03543qGqe5zRsOiQ/gJfA==","shasum":"2b5ca358aa74cebd6a97fc628ed4acbd50f53567","tarball":"https://registry.npmjs.org/@coconut-packages/um-middlewares/-/um-middlewares-0.0.3.tgz","fileCount":3,"unpackedSize":3360,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDNaELltk+IQ19Nez8S8FDqFnXUPH9b6Bx8pBPy6JdgYwIgG8d8C0ilsYAUxY9DgINLzb7cAUGXRHLxb8ZyM32oh/k="}]},"_npmUser":{"name":"namankhater","email":"naman22khater@gmail.com"},"directories":{},"maintainers":[{"name":"namankhater","email":"naman22khater@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/um-middlewares_0.0.3_1755938569585_0.1273330353457678"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-23T19:46:38.780Z","modified":"2025-08-23T08:42:50.007Z","0.0.1":"2025-06-23T19:46:39.021Z","0.0.2":"2025-08-15T19:35:21.507Z","0.0.3":"2025-08-23T08:42:49.780Z"},"license":"ISC","keywords":[],"description":"/**\r  * Middleware to authenticate JWT tokens in incoming HTTP requests.\r  *\r  * Extracts the Bearer token from the `Authorization` header, verifies its validity,\r  * and attaches the corresponding user object to the request if authentication succeeds.\r  ","maintainers":[{"name":"namankhater","email":"naman22khater@gmail.com"}],"readme":"/**\r\n * Middleware to authenticate JWT tokens in incoming HTTP requests.\r\n *\r\n * Extracts the Bearer token from the `Authorization` header, verifies its validity,\r\n * and attaches the corresponding user object to the request if authentication succeeds.\r\n * Responds with appropriate HTTP status codes and error messages if:\r\n *   - The token is missing (401 Unauthorized)\r\n *   - The token is invalid or expired (403 Forbidden)\r\n *   - The user associated with the token does not exist (404 Not Found)\r\n *\r\n * @param {Object} req - Express request object, expects `authorization` header and `mongoose` instance.\r\n * @param {Object} res - Express response object, used to send error responses.\r\n * @param {Function} next - Express next middleware function.\r\n *\r\n * @returns {void}\r\n */","readmeFilename":"README.md"}