❔ Retrieving a token from a login function
Im currently supposed to login from one endpoint, and retrieve extra user information from another, i need to return both a token and the user data with just one responseObject. The token is needed to retrieve the userinformation, I currently have a LoginService that returns a token on a succesful login, how can i ''merge'' the 2 pieces of information, and return it as one responseObject?
2 Replies
You can create a model "LoginResponse" which will have both token and the responseObject object as its properties.
For example -
I'm using the above model in a personal project I'm working on.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.