That should have been change to Optional.ofNullable(WebUtils.getCredential(requestContext, UsernamePasswordCredential.class)) .ifPresent(credential -> bean.setCurrentPassword(credential .getPassword()));
On Monday, 27 March 2023 at 16:39:48 UTC+11 Colin Wilkinson wrote: > Hi, > > I think you have a slight coding mistake in PasswordChangeAction.java. > When we were testing change password the other current password was coming > back null. > > I believe you have a coding mistake in the following lines of code as in > the below code you are just setting it back to itself. > > Optional.ofNullable(WebUtils.getCredential(requestContext, > UsernamePasswordCredential.class)) > .ifPresent(credential -> > bean.setCurrentPassword(bean.getCurrentPassword())); > > What I think you meant was > > Optional.ofNullable(WebUtils.getCredential(requestContext, > UsernamePasswordCredential.class)) > .ifPresent(credential -> > bean.setCurrentPassword(credential .getToPassword())); > > Regards, > Colin > -- - Website: https://apereo.github.io/cas - Gitter Chatroom: https://gitter.im/apereo/cas - List Guidelines: https://goo.gl/1VRrw7 - Contributions: https://goo.gl/mh7qDG --- You received this message because you are subscribed to the Google Groups "CAS Community" group. To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscr...@apereo.org. To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/f12935a5-ccbf-45e8-8b1f-1e38489f5cf7n%40apereo.org.