2014-06-26 42 views
2

我想註冊使用火力地堡簡單登錄機制的用戶:

angular.module('MyApp').controller('LoginCtrl', function($scope, $firebaseSimpleLogin, FIREBASE_ROOT) { 
    $scope.loginService = $firebaseSimpleLogin(new Firebase(FIREBASE_ROOT)); 
    $scope.user = { 
    email: '', 
    password: '' 
    }; 

    $scope.register = function() { 
    console.log('creating user...'); // I see this 
    $scope.loginService.$createUser($scope.email, $scope.password).then(function(user) { 
     console.log('done!'); // But not this 
     console.log(user); 
    }); 
    }; 
}); 

但是,我看到下面的錯誤在控制檯:

Uncaught SecurityError: Blocked a frame with origin 
"https://s-dal5-nss-15.firebaseio.com" from accessing a frame with origin 
"http://localhost:8100". The frame requesting access has a protocol of "https", 
the frame being accessed has a protocol of "http". Protocols must match. 

和,不執行$createUser回調。

我啓用了「電子郵件&密碼」驗證,並將localhost放在授權請求源列表中。

我在做什麼錯?

+0

嘿你是如何解決這個問題的?我也面對 –

回答

1

簡而言之,您的「域」(本例中爲localhost)爲http,而原點爲https,這往往會導致這些類型的錯誤。我相信,如果他們匹配(但是,在這種情況下,兩者都必須HTTPS),這將不再是一個問題:

請求訪問的框架具有的「https」開頭的協議,框架 被訪問有一個協議「http」。 協議必須匹配。

一些更多的信息可以在REST API Reference | Firebase Documentation找到:即HTTPS需要

注意。 Firebase只響應加密流量,以便您的數據保持安全。

相關問題