1

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

Thanks in advance

2
  • 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
    Jul 17 '18 at 20:52
  • Thanks for replying. This is a front-end request. So I should write a plug-in to do it ?? Jul 18 '18 at 6:26
1

Craft has a similar concept in the Control Panel for changing sensitive data like passwords/emails you could model called "elevated sessions".

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, if you need it to last for period of time, or just validate the password and let it go through once.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.