<p>Those docs were a bit confusing/misleading, so sorry about that. (I don’t even know what it meant by that!)</p>

<p>They’ve been updated for clarity:</p>

<blockquote>
  <p>After the user successfully logs in, they will be redirected to the path defined by the <a href="https://docs.craftcms.com/v3/config/config-settings.html#setpasswordsuccesspath" rel="nofollow noreferrer">setPasswordSuccessPath</a> config setting.</p>
</blockquote>

<p>Additionally, the next Craft release (3.1.8) will start automatically logging users in after resetting their password, if the <a href="https://docs.craftcms.com/v3/config/config-settings.html#autologinafteraccountactivation" rel="nofollow noreferrer">autoLoginAfterAccountActivation</a> config setting is enabled.</p>

<p>So to answer your question, there won’t be any custom plugin/module code needed for this; just update to 3.1.8 when it comes out and enable that config setting.</p>

CC BY-SA 4.0
2019-02-03T01:36:30.437Z
2019-02-03T01:36:30.437Z
Brandon Kelly
<p>Unlike in Craft2, there doesn't seem to be a way in Craft3 for a plugin to automatically login a user after a password reset. </p>

<p>In Craft2, a plugin could listen for <code>users.onSetPassword</code> to determine when a user had reset their password, and then log the user in.</p>

<p>However, Craft3 doesn't seem to raise any suitable event -- presumably if it did, it would be done in <code>UsersController-&gt;actionSetPassword</code>.</p>

<p><a href="https://docs.craftcms.com/v3/dev/examples/set-password-form.html" rel="nofollow noreferrer">The documentation</a> does state: </p>

<blockquote>
  <p>The setPasswordSuccessPath config setting designates where the user should be redirected to after they finish resetting their password (and get automatically logged-in).</p>
</blockquote>

<p>However, this bit about getting automatically logged in doesn't seem to apply when <code>setPasswordSuccessPath</code> is set.</p>

<p>Is there something that I'm missing here?</p>

<craft3><password>
Auto login user after password reset via a plugin in Craft3
# Auto login user after password reset via a plugin in Craft3

(Asked by: username_0 on 2019-01-26)

Unlike in Craft2, there doesn't seem to be a way in Craft3 for a plugin to automatically login a user after a password reset.

In Craft2, a plugin could listen for `users.onSetPassword` to determine when a user had reset their password, and then log the user in.

However, Craft3 doesn't seem to raise any suitable event -- presumably if it did, it would be done in `UsersController->actionSetPassword`.

[The documentation](https://docs.craftcms.com/v3/dev/examples/set-password-form.html) does state:

> The setPasswordSuccessPath config setting designates where the user should be redirected to after they finish resetting their password (and get automatically logged-in).

However, this bit about getting automatically logged in doesn't seem to apply when `setPasswordSuccessPath` is set.

Is there something that I'm missing here?

**Tags:** craft3, password

---

## 1 answers

### Answer by username_1 on 2019-02-03. Score: 2

Those docs were a bit confusing/misleading, so sorry about that. (I don’t even know what it meant by that!)

They’ve been updated for clarity:

> After the user successfully logs in, they will be redirected to the path defined by the [setPasswordSuccessPath](https://docs.craftcms.com/v3/config/config-settings.html#setpasswordsuccesspath) config setting.

Additionally, the next Craft release (3.1.8) will start automatically logging users in after resetting their password, if the [autoLoginAfterAccountActivation](https://docs.craftcms.com/v3/config/config-settings.html#autologinafteraccountactivation) config setting is enabled.

So to answer your question, there won’t be any custom plugin/module code needed for this; just update to 3.1.8 when it comes out and enable that config setting.


---

