{"info":{"_postman_id":"1f9a3b35-cec6-45fd-ae92-e8092a7a4e65","name":"ExpressJS Complete Authentication","description":"<html><head></head><body><p>Experience the power of role-based authentication in Express.js. Separate routers ensure secure authentication and access control. Manage user registration, login, and data retrieval, while admins handle admin-specific tasks.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"27027258","collectionId":"1f9a3b35-cec6-45fd-ae92-e8092a7a4e65","publishedId":"2sA3JRZeuT","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-05-16T08:45:17.000Z"},"item":[{"name":"Admin","item":[{"name":"adminData","id":"2d121153-283c-447f-a3d6-18ce6fa20c20","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://expressjs-complete-authentication.vercel.app/api/admins","description":"<p>It retrieves information about a specific admin based on the cookie set in browser. It allow admin for fetching detailed information about him within the system.</p>\n","urlObject":{"protocol":"https","path":["api","admins"],"host":["expressjs-complete-authentication","vercel","app"],"query":[],"variable":[]}},"response":[],"_postman_id":"2d121153-283c-447f-a3d6-18ce6fa20c20"},{"name":"usersData","id":"969e09f9-55f2-4f5f-a1e1-c04f210d4e5a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://expressjs-complete-authentication.vercel.app/api/admins/users/all","description":"<p>It retrieves information about all users registered in the application. It returns a list of users with details such as <code>firstName</code>, <code>lastName</code>, <code>email</code>, <code>phoneNumber</code>, <code>profilePicture</code> URL, and <code>createdAt</code> timestamp indicating when each user account was created. Only authorized admin can access the information.</p>\n","urlObject":{"protocol":"https","path":["api","admins","users","all"],"host":["expressjs-complete-authentication","vercel","app"],"query":[],"variable":[]}},"response":[],"_postman_id":"969e09f9-55f2-4f5f-a1e1-c04f210d4e5a"},{"name":"adminLogin","id":"8359ac51-75b8-481c-b7d6-85111a8fe784","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"sajib@gmail.com\",\r\n    \"password\": \"123aBc@#$\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://expressjs-complete-authentication.vercel.app/api/admins/login","description":"<p>Provide an interface for admin to perform authentication within the application. It requires two parameters: <code>email</code> and <code>password</code>. Upon successful authentication, a cookie is set to the browser, which is used to access to authenticated endpoints and administrative functionalities.</p>\n","urlObject":{"protocol":"https","path":["api","admins","login"],"host":["expressjs-complete-authentication","vercel","app"],"query":[],"variable":[]}},"response":[],"_postman_id":"8359ac51-75b8-481c-b7d6-85111a8fe784"},{"name":"remove user","id":"3216f665-9f23-4fd4-a1e4-f697dd91cd0b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"https://expressjs-complete-authentication.vercel.app/api/admins/users/6644105badc1ce38226ae63a","description":"<p>It is used to remove a user account from database. It requires <code>userId</code> parameter, which specifies the ID of the user to be removed. Only authorized admin can perform this operation. Upon execution, this request permanently deletes the user's account and associated data from the system.</p>\n","urlObject":{"protocol":"https","path":["api","admins","users","6644105badc1ce38226ae63a"],"host":["expressjs-complete-authentication","vercel","app"],"query":[],"variable":[]}},"response":[],"_postman_id":"3216f665-9f23-4fd4-a1e4-f697dd91cd0b"},{"name":"userData","id":"38caed4f-ab90-422a-b18a-90c319e52b1c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://expressjs-complete-authentication.vercel.app/api/admins/users/6644105badc1ce38226ae63a","description":"<p>It retrieves information about a specific user based on the paraeter of the url. It allows admin for fetching detailed information about an individual within the system.</p>\n","urlObject":{"protocol":"https","path":["api","admins","users","6644105badc1ce38226ae63a"],"host":["expressjs-complete-authentication","vercel","app"],"query":[],"variable":[]}},"response":[],"_postman_id":"38caed4f-ab90-422a-b18a-90c319e52b1c"}],"id":"28189883-a78d-4d4b-a5d6-d2ce5e1986dd","description":"<p>Admins can log in using their email or mobile number and password, correct information set cookie in browser, which is used for secure subsequent requests.</p>\n","_postman_id":"28189883-a78d-4d4b-a5d6-d2ce5e1986dd"},{"name":"User","item":[{"name":"userData","id":"4f91c2fb-aa68-46fc-947d-b7a85717a907","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"https://expressjs-complete-authentication.vercel.app/api/users","description":"<p>This request retrieve information about a specific user based on the token store in cookie. It returns the user's <code>firstName</code>, <code>lastName</code>, <code>email</code>, <code>phoneNumber</code>, <code>createdAt</code> timestamp indicating when the user account was created, and <code>profilePicture</code> URL if available. This query allows for fetching detailed user information for various purposes within the application.</p>\n","urlObject":{"protocol":"https","path":["api","users"],"host":["expressjs-complete-authentication","vercel","app"],"query":[],"variable":[]}},"response":[],"_postman_id":"4f91c2fb-aa68-46fc-947d-b7a85717a907"},{"name":"userRegistration","id":"b0a79c52-36a3-4ceb-80ea-1e7398aa4ef6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"firstName\": \"Masum\",\r\n    \"lastName\": \"Billah\",\r\n    \"email\": \"masum184e@gmail.com\",\r\n    \"phoneNumber\": \"01400095352\",\r\n    \"password\": \"123aBc@#$\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://expressjs-complete-authentication.vercel.app/api/users/registration","description":"<p>It is used to register a new user in the application. It requires the following parameters: firstName, lastName, email, phoneNumber, and password. Upon successful registration, It store a token in browser, allowing the user to access authenticated endpoints.</p>\n","urlObject":{"protocol":"https","path":["api","users","registration"],"host":["expressjs-complete-authentication","vercel","app"],"query":[],"variable":[]}},"response":[],"_postman_id":"b0a79c52-36a3-4ceb-80ea-1e7398aa4ef6"},{"name":"userLogin","id":"e3c6ffe1-984e-4ffb-99c3-16830c40cd5e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"identifier\": \"masum184e@gmail.com\",\r\n    \"password\": \"123aBc@#$\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://expressjs-complete-authentication.vercel.app/api/users/login","description":"<p>It is utilized for user authentication within the application. It requires two parameters: identifier, which can be either the user's <code>email</code> or <code>phoneNumber</code>, and password. Upon successful login, it store a token in the browser, allowing the user to access authenticated endpoints.</p>\n","urlObject":{"protocol":"https","path":["api","users","login"],"host":["expressjs-complete-authentication","vercel","app"],"query":[],"variable":[]}},"response":[],"_postman_id":"e3c6ffe1-984e-4ffb-99c3-16830c40cd5e"},{"name":"userUploadProfilePicture","id":"5144acc1-4b0b-4bc8-b81e-661884340da7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"profilePicture","type":"file","src":"/C:/Users/USER/OneDrive/Pictures/masum billah.jpg"}]},"url":"https://expressjs-complete-authentication.vercel.app/api/users/upload-profile-picture","description":"<p>This route allow users to upload or update their profile pictures. It requires token from cookie to verify the user and the image file to be uploaded. It enables users to personalize their profiles by adding or changing their profile pictures.</p>\n","urlObject":{"protocol":"https","path":["api","users","upload-profile-picture"],"host":["expressjs-complete-authentication","vercel","app"],"query":[],"variable":[]}},"response":[],"_postman_id":"5144acc1-4b0b-4bc8-b81e-661884340da7"},{"name":"userResetPasswordResetSendOTP","id":"6ecd9f16-4228-45b5-95ff-50089c46031e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":"{\r\n    \"phoneNumber\":\"01400095352\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://expressjs-complete-authentication.vercel.app/api/users/reset-password-otp","description":"<p>This route triggers the sending of a OTP to the specified mobile number. It response a verification token as well which is used to verify the OTP.</p>\n","urlObject":{"protocol":"https","path":["api","users","reset-password-otp"],"host":["expressjs-complete-authentication","vercel","app"],"query":[],"variable":[]}},"response":[],"_postman_id":"6ecd9f16-4228-45b5-95ff-50089c46031e"},{"name":"Reset Password","id":"a2ce97e9-7520-4dca-a591-b20488bc519e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"otp\": \"\",\r\n    \"newPassword\": \"\",\r\n    \"confirmPassword\": \"\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://expressjs-complete-authentication.vercel.app/api/users/reset-password/a/a","description":"<p>It is used to reset a user's password. It requires two parameters from URL: <code>verificationToken</code> which is used to verify OTP, and <code>token</code> which is used to verify the user. This end point enables securely reset the passwords after initiating the process.</p>\n","urlObject":{"protocol":"https","path":["api","users","reset-password","a","a"],"host":["expressjs-complete-authentication","vercel","app"],"query":[],"variable":[]}},"response":[],"_postman_id":"a2ce97e9-7520-4dca-a591-b20488bc519e"}],"id":"ad2087be-c08e-439c-855f-f88612aa2328","description":"<p>Users can effortlessly register and authenticate, ensuring secure access to their accounts. They have the flexibility to manage their profiles, update personal information, and reset passwords securely. With features like profile picture uploading, users can personalize their profiles, making their experience more engaging.</p>\n","_postman_id":"ad2087be-c08e-439c-855f-f88612aa2328"}]}