Should I return user data in an authentication endpoint using JWT?

Viewed 1304

I implement an auth endpoint which takes an email and password and returns a JWT token. Inside the JWT there is a payload containing the user ID. Does it matter from a REST/JWT standards perspective which of these approaches I take?

  1. return the token and let the client request the /users/user_id resource on a callback with the decoded user_id and the token
  2. return the entire user object with the token from the /auth endpoint for the convenience of the client.

(my question is implementation/library agnostic and about the api-design pattern)

1 Answers
Related