Skip to content

Commit

Permalink
return user
Browse files Browse the repository at this point in the history
  • Loading branch information
mudroljub committed Dec 15, 2024
1 parent 854e289 commit 5f29ba1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/controllers/AuthController.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ const getToken = async(req, res) => {
try {
const user = await UserService.findOrCreate(email, password)
const token = AuthService.createToken(user)
res.json({ message: 'Welcome to Programming Quotes API', token })

res.json({ message: 'Welcome to Programming Quotes API', token, user })
} catch (err) {
const status = err.message === 'BAD_PASSWORD' ? 400 : 500
res.status(status).json({ message: err.message })
Expand Down

0 comments on commit 5f29ba1

Please sign in to comment.