Angular-app, authentication and order of resolvers in (ui-)router

后端 未结 2 816
离开以前
离开以前 2021-01-12 02:14

This questions refers to the angular-app project and the way it authenticates users.

The original implementation guards access to some urls by using resolve clause o

2条回答
  •  被撕碎了的回忆
    2021-01-12 02:35

    Have you tried something like this.

    return securityAuthorizationProvider.requireAuthenticatedUser().then(function() {
        return Restangular.all('tickets').getList();
    });
    

    Basically requireAuthenticatedUser returns a promise so you can chain it with the call to Restangular call.

提交回复
热议问题