0

제발 도와주세요 나는 각도 유성을 사용하고 있습니다.Meteor Accounts.onEmailVerificationLink가 작동하지 않습니다.

나는 (클릭 사용자에게 토큰 URL을 전송) Accounts.sendVerificationEmail() 이미 토큰을 캡처 한 를 통해 자신의 이메일을 확인하기 위해 사용자를 원하고, 내 문제가있는 console.log()

에서 볼 수 있습니다 onEmailVerificationLink에서 토큰 매개 변수를 전달하더라도 실행되지 않습니다. 는 클라이언트

my-app\imports\ui\components\verifyMail\verifyMail.html 

console.log()

다음 내 코드로 인쇄되지 않기 때문에이 확인할 수 있습니다.

class VerifyMail { 
    constructor($reactive, $scope, $stateParams) { 
     'ngInject'; 
     $reactive(this).attach($scope); 
     this.token = $stateParams.token; 
     this.verifyLink(); 
    } 

    verifyLink() { 
     this.$bindToContext(
      Accounts.onEmailVerificationLink((token, done) => { 
       console.log('CANT PRINT THIS CONSOLE LOG'); 
      }) 
     ); 
    } 
} 

답변

0

전자 메일 확인 콜백은 서버에서 발생합니다.

은 또는 당신은, 당신은 같은 것을 할 수 있습니다 (https://atmospherejs.com/matb33/collection-hooks)를 수집 후크를 사용하는 경우 :

Meteor.users.after.update(function (userId, doc, fieldNames, modifier, options) { 
    if (!!modifier.$set) { 
    //check if the email was verified 
    if (modifier.$set['emails.$.verified'] === true) { 
     //do something 
    } 
    } 
}); 
관련 문제