Cannot change password on my profile page
Application Type
Reactive

Hello, 


Still busy with the signup part of the challenge.

So I have a profile page where a user can change her/his password.


But if I try it with the same loginname and password  I also use for logging in outsystems I see a message that the password I give is not the same as the current password.


A user has to give the current password to change her/his password as a check the user is really who he/she is.


What did I do wrong ?


Roelof


neo-social-place.oap

Solution
I think your error starts from here. You need to have password2 there as it is selected. Because you are not using the provided password from the user at the start but, of course, you are using your own password, your own user... but if you create another one is not going to work


After that, you cannot compare two encrypted passwords like this. you need to use the validation password function to do that. Where you are going to validate the password and the stored password

You can use this PlatformPasswordUtils API 

Dont forget that now when encrypting you need to do generate the SaltedMD5HashPassword.

If I said something wrong let me know.

Kind Regards,

Márcio


mvp_badge
MVP

Hello Roelof.

Have you used the EncryptPassword function? That is the most common error. You can only compare the typed password with the encrypted one, if you encrypt the first.


yes, I have used the EncryptPassword function.

Why are you encrypting using the password from the entity user you are passing instead of the password2 variable that you are passing that comes from the form?

Try to change to password2, when you are encrypting.

Kind Regards,

Márcio

I did but it is not solving the problem I have now

Solution
I think your error starts from here. You need to have password2 there as it is selected. Because you are not using the provided password from the user at the start but, of course, you are using your own password, your own user... but if you create another one is not going to work


After that, you cannot compare two encrypted passwords like this. you need to use the validation password function to do that. Where you are going to validate the password and the stored password

You can use this PlatformPasswordUtils API 

Dont forget that now when encrypting you need to do generate the SaltedMD5HashPassword.

If I said something wrong let me know.

Kind Regards,

Márcio


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.