Change password enonic 6.1.1

Hi
I want to change a password of an user so I was implemented this code:

var user = auth.getUser();
auth.changePassword({
userKey: user.key,
password: req.params[‘clavenuevacambioclave’]
});

However I got this error “com.enonic.xp.portal.impl.PortalException: TypeError: Cannot call undefined” on the line “changePassword”

Thank you for your help

I don’t think auth.changePassword() was implemented in 6.1.1. Try using XP 6.2.0 and update your libs in build.gradle.

What Michael says is true. ChangePassword is a feature added to XP 6.2.

Yes I test it and It works.

Thank you

1 Like