[英]Redirect view after login with facebook using Firebase and Ionic
身份驗證正常運行,但是登錄后,身份驗證將在同一視圖中繼續進行。
登錄后我需要他進入視圖dash.html
我在用戶登錄后重定向用戶嗎?
$scope.loginFacebook = function(){
var ref = new Firebase("https://<NAME>.firebaseio.com");
var authObject = $firebaseAuth(ref);
authObject.$authWithOAuthRedirect("facebook").then(function(authData) {
console.log(authData);
}).catch(function(error) {
console.log('error' + error);
})
}
我有同樣的問題。 我用了$state.go('tabs.home');
但我必須將其放在app.factory中而不是在控制器中。
auth.$onAuth(function(authData) {
$state.go('tabs.home');
if(authData) {
angular.copy(authData, Auth.user);
Auth.user.profile = $firebaseObject(....));
} else {
if(Auth.user && Auth.user.profile) {
}
angular.copy({}, Auth.user);
}
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.