DennisKip
DennisKip

Reputation: 29

I am not getting jwt token

I have a microservice that has a usermanagement service. In the service I created a .env file and stored my secret. It however does not a give a token when I bring up the services using docker-compose up.

enter image description here

(I have required doenv in my index.js, I have installed jwt, The .env is inside the service folder not the docker-compose folder)

kindly advice.

Upvotes: 0

Views: 137

Answers (1)

Ben Chamberlin
Ben Chamberlin

Reputation: 731

json() only takes one argument, but you're currently passing in two.

Change res.status(201).json(admin, token) to res.status(201).json({ admin, token })

Upvotes: 1

Related Questions