oc-shopaholic / oc-buddies-plugin

👥 October CMS user system
https://octobercms.com/plugin/lovata-buddies
GNU General Public License v3.0
31 stars 15 forks source link

Showing success message after password change #33

Open meysammahfouzi opened 5 years ago

meysammahfouzi commented 5 years ago

I've got the following ChangePassword component on change-password.htm page:

[ChangePassword]
slug_required = 0
mode = "submit"
flash_on = 1
redirect_on = 0
check_old_password = 1

After the form is submitted, the user will remain on the same page. Now I want to show a success message to them.

It's possible to check that change password got an error:

{% set arError = ChangePassword.getErrorMessage %}
{% if arError.message is not empty %}
    <p>{{ arError.message }}</p>
{% endif %}

But how to check the operation was successful? I don't won't to put the success message in the else statement because the first time that page loads that message will be shown.