{"repo":"murraco/node-jwt","free":true,"listed":false,"github":"https://github.com/murraco/node-jwt","clone":"git clone https://github.com/murraco/node-jwt.git","description":"JWT auth service with refresh using Node.js, ES6, Express, Sequelize and Mocha","language":"JavaScript","stars":29,"topics":["node","es6","jwt","express","sequelize","mocha","authentication"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"Node JWT A small JWT authentication service built with Express, Sequelize and MySQL. Stack Introduction (https://jwt.io) I have a great introduction to JWT in one of my other repositories, click here to take a look! File structure Quick start Start MySQL and create the databases: Run it: Check it is up — http://localhost:8000/api-status should return { \"status\": \"ok\" } . Set PORT to use a different port. Endpoints Method Path Auth Body --- --- --- --- GET /api-status – – POST /users – username , password GET /users Bearer – GET /users/:userId Bearer – PUT /users/:userId Bearer, owner only username DELETE /users/:userId Bearer, owner only – POST /auth – username , password POST /auth/refresh – username , refresh token Register a user: Sign in — returns a token and a refresh token : Use the token: Refresh tokens rotate: every issued JWT replaces the stored refresh token , so a given refresh token can be redeemed exactly once. Configuration Every value is read from the environment — see .env.example . Variable Default (dev/test) Required in production --- --- --- JWT SECRET insecure placeholder yes JWT DURATION 2 hours no DB HOST localhost no DB PORT 3306 no DB NAME jwt dev / jwt test no DB USER root yes DB PASSWORD root yes PORT 8000 no Generate a signing key with: Breaking changes If you are upgrading from an older clone, three things changed: 1. Credentials moved from the query string to the request body. POST /auth and POST /users used to read ?username=…&password=… . Query ","default_branch":null,"files":null,"tree":[],"storefront":"/r/murraco","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/murraco/node-jwt/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}