私はMeteorでWebサイトを運営しており、Google LogInを使用する際に問題が発生しています。ユーザーがボタンをクリックして電子メールとパスワードを要求すると、私のWebページは正しくログインし、Webページから正しくログアウトします。問題は、どういうわけか、私のページがUserIdをMeteorから守り、次にLogInボタンをクリックしたときにパスワードを要求しないということです。さらに、ログアウト後、YouTube、GMailなどにログインしようとすると、自分のウェブページからログアウトしたアカウントでログインします。 なぜこれが起こる可能性がありますか?私はそれが私のログアウト機能にこのコードを追加することが、うまくいきませんでした解決しようとしましたGoogle認定資格でMeteor Projectからログアウトできない
:
Template.user_loggedin.events({
"click #logout": function (e, tmpl) {
Meteor.logout(function (err) {
if (err) {
//An error occured
Bert.alert('Error al cerrar sesión. Por favor, vuelva a intentarlo', 'warning', 'fixed-top', 'fa-remove');
} else {
// your cleanup code here
Object.keys(Session.keys).forEach(function (key) {
Session.set(key, undefined);
});
Session.keys = {}; // remove session keys
Router.go('/'); // redirect to the home page or elsewhere using iron:router
Bert.alert('Cerrado sesión correctamente', 'success', 'fixed-top', 'fa-check');
}
});
}
});
私はhereから、このコードを取ったが、私はそれは同じ問題だかはわかりません。
そして、これが私のログイン機能である:
Template.user_loggedout.events({
"click #login": function (e, tmpl) {
e.preventDefault();
Meteor.loginWithGoogle({
//Show what information is needed from the user
requestPermissions: ['profile', 'email', 'https://www.googleapis.com/auth/spreadsheets']
}, function (err) {
if (err) {
Session.set('errorMessage', err.reason || 'Unknown error');
Bert.alert('Error al Iniciar Sesión. Por favor, vuelva a intentarlo', 'warning', 'fixed-top', 'fa-remove');
} else {
Bert.alert('Iniciado sesión correctamente', 'success', 'fixed-top', 'fa-check');
}
});
}
});