【发布时间】:2017-07-14 22:11:11
【问题描述】:
我正在尝试创建一个帐户页面,用户可以在其中更新他们的个人资料信息和/或更新他们的密码。我目前正在将其用于表单:
{{#autoForm collection="Meteor.users" doc=profile id="myAccount" type="update"}}
<fieldset>
<legend>My Account</legend>
{{> afQuickField name="username"}}
{{> afQuickField name="profile.firstName"}}
{{> afQuickField name="profile.lastName"}}
{{> afQuickField name="emails.0.address"}}
{{> afQuickField name="emails.0.verified" class="i-checks"}}
{{> afQuickField name="password"}}
</fieldset>
<button type="submit" class="btn btn-primary">Update</button>
{{/autoForm}}
据我了解,我需要使用 Accounts.setPassword 来更新用户密码。所以我想我必须为此使用一个钩子,但是 onSubmit 钩子不适用于类型更新。
用这种形式更新密码的最佳方法是什么?
【问题讨论】:
标签: meteor passwords meteor-autoform