I'm using loopback with the angular sdk on the front-end. I want to get the information about the logged in user; so I do the following:
User.getCurrent()
.$promise
.then((currentUser) => console.log(currentUser));
but the server responds with 401 unauthorized request.
code: "AUTHORIZATION_REQUIRED"
message: "Authorization Required"
name: "Error"
How can I get the info of the current user?