本文整理汇总了TypeScript中meteor/accounts-base.Accounts.forgotPassword方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Accounts.forgotPassword方法的具体用法?TypeScript Accounts.forgotPassword怎么用?TypeScript Accounts.forgotPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meteor/accounts-base.Accounts
的用法示例。
在下文中一共展示了Accounts.forgotPassword方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: reset
reset() {
Accounts.forgotPassword(this.credentials, this.$bindToContext((err) => {
if (err) {
this.error = err;
} else {
this.$state.go('parties');
}
}));
}
示例2: recover
recover(credentials) {
if (this.recoverForm.valid) {
Accounts.forgotPassword({ email: credentials.email}, (err) => {
if (err) {
this.error = err;
}
else {
this.router.navigate(['/']);
}
});
}
}
示例3: recover
recover() {
this.resetErrors();
Accounts.forgotPassword({email: this.credentials.email}, (error) => {
if (error) {
this.errors.push(error.reason || "Unknown error");
}
else {
this.message = "You will receive further instruction to you email address!";
this.isDropdownOpen = false;
this._resetCredentialsFields();
}
});
}
示例4: recover
recover() {
if (this.recoverForm.valid) {
Accounts.forgotPassword({
email: this.recoverForm.value.email
}, (err) => {
if (err) {
this.zone.run(() => {
this.error = err;
});
} else {
this.router.navigate(['/']);
}
});
}
}
示例5: emailResetLink
}
return false;
},
emailResetLink ({__}: IContext, email: string, callback: Function) {
clearMessages();
if (isNotEmpty(email) && isEmail(email)) {
Accounts.forgotPassword({email: email}, function(err: any) {
callback();
if (err) {
if (err.message === "User not found [403]") {
showError("accounts.error.emailNotFound");
} else {
showError("accounts.error.unknownError");
}
} else {
showInfo("accounts.messages.passwordResetEmailSent");
}
});
}
return false;
},
resetPassword ({__, Session}: IContext, password: string, passwordConfirm: string, callback: Function): void {
if (isNotEmpty(password) && areValidPasswords(password, passwordConfirm)) {
const token = Session.get(TOKENKEY);
Accounts.resetPassword(token, password, function(err: any) {