0

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?

ppoliani
  • 4,792
  • 3
  • 34
  • 62
  • You may want to review: https://github.com/strongloop/loopback/issues/426 It may be a result of your ACLs – JSimonsen Aug 31 '15 at 20:02

1 Answers1

0

Try adding an acl for $authenticated users, I think it worked for me in the past. It is not natural, cause one might expect the $owner to be the right choice, but it works.

Meir
  • 14,081
  • 4
  • 39
  • 47