2

我有一个部分需要登录和特定角色(“高于 19”)。每当我从中注销时,我都会得到

Error: permission_denied: Client doesn't have permission to access the desired data.

原因是我的安全设置:

".read": "root.child('users').child(auth.uid).child('data').child('role').val() > 19",

我的注销功能:

// Sign out functionality
App.controller('SignOutCtrl', function($scope, $state, Auth) {

    $scope.logout = function() {

        // Go to landing page
        $state.go('home');

        // Log user out
        Auth.$unauth();

    };
});


App.factory('Auth', ['$firebaseAuth', function($firebaseAuth) {

    var firebase = new Firebase('https://mysite.firebaseio.com/');

    return $firebaseAuth(firebase);

}]);

$state 'home' 没有任何读取限制,看起来注销实际上发生在我被重定向到触发安全限制的 'home'-$state 之前。

我想我很难理解如何在不触发安全设置的情况下从受限站点注销的基本概念,谁能解释我如何正确地做到这一点?

4

1 回答 1

1

我建议在加载注销页面时而不是在离开受限页面之前取消身份验证。

于 2015-06-01T15:04:04.263 回答