I'm trying to modify Craft 3's example 'Change password' form to work with a logged in Commerce 2 user, and have copied that code to templates/setpassword.twig
.
Two problems...
(1) The {{ code }} and {{ id }} variables throw Don't exist errors.
(2) If I comment those variables out, I get a Page not found/"Unable to resolve the request: users/setPassword" error when submitting the form.
Clearly I'm doing this totally wrong 🙃... can anyone set me straight?
<form method="post" accept-charset="UTF-8">
{{ csrfInput() }}
<input type="hidden" name="action" value="users/set-password">
<input type="hidden" name="code" value="{{ code }}">
<input type="hidden" name="id" value="{{ id }}">
<h3><label for="newPassword">New Password</label></h3>
<input id="newPassword" type="password" name="newPassword">
{% if errors is defined %}
<ul class="errors">
{% for error in errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
<input type="submit" value="Submit">