hakhsin's avatar

What do I response after user registered with API?

Hi, Which one of below response is the best practice after user registered?

a- Return user's information, like username, email, and etc.

b- Return Access Token.

Are there any convention for this case?

0 likes
1 reply
douglasakula's avatar
Level 15

IMO. For registration - the user object will do. (It might include the access token in some instances). the access token is optional because the registration use case is not logging the user into the account.

For login API call - its ideal to return the access token at the very minimum because this will be required to validate subsequent requests after login is successful.

1 like

Please or to participate in this conversation.