<p>Craft has a similar concept in the Control Panel for changing sensitive data like passwords/emails you could model called <a href="https://craftcms.com/news/new-security-features" rel="nofollow noreferrer">"elevated sessions"</a>.</p>

<p>You could write a custom plugin and your form could post to an action in a controller in your plugin, which could check if the phone number for that user has changed.</p>

<p>If so, you'd prompt the user to enter their current password and either do something similar to Craft's <a href="https://github.com/craftcms/cms/blob/develop/src/controllers/UsersController.php#L231-L239" rel="nofollow noreferrer">UsersController->actionStartElevatedSession</a>, if you need it to last for period of time, or just validate the password and let it go through once.</p>

CC BY-SA 4.0
2018-07-18T23:47:14.200Z
2018-07-18T23:47:14.200Z
Brad Bell
<p>Is it possible to enforce users to enter their password when changing their data?
For example when changing their phone number.</p>

<p>Thanks in advance</p>

CC BY-SA 4.0
2018-07-17T20:52:30.590Z
Is this in the context of a front-end request or editing a user in the Control Panel? Are you comfortable with writing a plugin/PHP?
Brad Bell
CC BY-SA 4.0
2018-07-18T06:26:26.647Z
Thanks for replying.
This is a front-end request. So I should write a plug-in to do it ??
Flying Car 0013
<elevated-session>
How do I make it required to enter password when changing user data?
# How do I make it required to enter password when changing user data?

(Asked by: username_0 on 2018-07-17)

Is it possible to enforce users to enter their password when changing their data?
For example when changing their phone number.

Thanks in advance

**Tags:** elevated-session
> **Comments:**
> **username_1**: Is this in the context of a front-end request or editing a user in the Control Panel? Are you comfortable with writing a plugin/PHP?  
> **username_0**: Thanks for replying. This is a front-end request. So I should write a plug-in to do it ??  

---

## 1 answers

### Answer by username_1 on 2018-07-18. Score: 1

Craft has a similar concept in the Control Panel for changing sensitive data like passwords/emails you could model called ["elevated sessions"](https://craftcms.com/news/new-security-features).

You could write a custom plugin and your form could post to an action in a controller in your plugin, which could check if the phone number for that user has changed.

If so, you'd prompt the user to enter their current password and either do something similar to Craft's [UsersController->actionStartElevatedSession](https://github.com/craftcms/cms/blob/develop/src/controllers/UsersController.php#L231-L239), if you need it to last for period of time, or just validate the password and let it go through once.


---

