2015-01-20 6 views
0

Как загрузить новую страницу после успешного входа в систему с помощью кнопки Google api?Загрузите страницу после успешного входа в Google

Это то, что мой Javascript выглядит (задается Google):

function signinCallback(authResult) { 
if (authResult['status']['signed_in']) { 
// Update the app to reflect a signed in user 
// Hide the sign-in button now that the user is authorized, for example: 
window.location.href='main.html' 
document.getElementById('signinButton').setAttribute('style', 'display: none'); 
} else { 
// Update the app to reflect a signed out user 
// Possible error values: 
// "user_signed_out" - User is signed-out 
// "access_denied" - User denied access to your app 
// "immediate_failed" - Could not automatically log in the user 
console.log('Sign-in state: ' + authResult['error']); 
} 
} 

Что я должен заполнить, чтобы обновить приложение на мою страницу, main.html?

+0

вы используете 'счетов-google' метеоритный пакет? – ajduke

ответ

1

если вы используете iron:router, вы можете попробовать это.

function signinCallback(authResult) { 
Router.go('/') //or whatever path you want to go 
document.getElementById('signinButton').setAttribute('style', 'display: none'); 
} 

, если у вас нет железа: маршрутизатор просто добавить его Meteor add iron:router

и первый настроить путь

Router.route('/', {name: 'mainPage'}); 
Смежные вопросы