本文整理匯總了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) {