How do you currently logged in user object when using restangular?

55 Views Asked by At

I have tried this but it seems not to be working what am I missing

Restangular.one('authenticated_user').get().then(function(response){
    return response;
}, function(response){
    return response;
});
1

There are 1 best solutions below

0
On

I figured it out!

function getAuthenticatedUser(onSuccess, onError){

        Restangular.one('authenticated_user').get().then(function(response){

            onSuccess(response.user);

        }, function(response){

            onError(response);

        });

    }