Skip to content

slava-lu/koa-jwt-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JWT Authentication for http and WebSockets for Node.js

How to use:

  • Do not forget to start mongod on the local PC before launching the node server

  • To send http request you may use Postman

  • To create a new user make a POST request to http://localhost:3000/user with the body:

{
	"displayName": "Slava",
	"email": "slava@mail.ru",
	"password": "111111"
}
{
	"email": "slava@mail.ru",
	"password": "111111"
}
  • Check authentication via JWT by sending GET request to http://localhost:3000/custom You need to copy JWT from the response of the previous request and copy it to the Header with the Authorization key рисунок

  • Check websocket JWT auth by launching the browser and going to http://localhost:3000. Before it you need to copy JWT in jwt variable in public/socketEmitter file

About

Node.js JWT authentication demo app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published