graphql-jwt-auth icon indicating copy to clipboard operation
graphql-jwt-auth copied to clipboard

Handling Authentication In GraphQL - JWT Authentication

graphql-jwt-auth

Adding authentication with JWT to a GraphQL server

Getting Started

Clone the project repository by running the command below if you use SSH

git clone [email protected]:ammezie/graphql-jwt-auth.git

If you use https, use this instead

git clone https://github.com/ammezie/graphql-jwt-auth.git

After cloning, run:

npm install

Rename .env.example to .env then fill in your database detail and your JWT secret:

NODE_ENV=development
DB_HOST=localhost
DB_USERNAME=root
DB_PASSWORD=
DB_NAME=graphql_jwt_auth
JWT_SECRET=

Then run the migration:

sequelize db:migrate

And finally, start the application:

npm start

The server will be running on http://localhost:3000/api.