setelis / angular-se-authentication

Authentication helpers used in some Setelis projects. Navigate to login if 401, after login - go to the state the user was in.
MIT License
0 stars 0 forks source link

Fix restangular url in setLogged #4

Open ptanov opened 8 years ago

ptanov commented 8 years ago
function setLogged(response) {
    service.currentLoggedMemberHolder.member = response;
    service.currentLoggedMemberHolder.logged = !!response;
    deferred.resolve(response);

vvvvvv // in config: // SeAjaxHelperService.fixRestangularUrl(response, $injector.get("MembersService").$membersOneRest(response.id)); ^^^^ return $q.when(response); }

ptanov commented 8 years ago

Blocked by #13

ptanov commented 8 years ago

Current way to do this:

SeAuthenticationService.addAuthenticationListener({
    onLogged: function(member) {
        SeAjaxHelperService.fixRestangularUrl(member.company, Restangular.one(REST.COMPANIES, member.company.id));
        });
    }