CAS 7.0.0-RC5 change passsword issue

21 views
Skip to first unread message

Colin Wilkinson

unread,
Mar 27, 2023, 1:39:48 AM3/27/23
to CAS Community
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

Colin Wilkinson

unread,
Mar 28, 2023, 1:18:32 AM3/28/23
to CAS Community, Colin Wilkinson
That should have been change to
Optional.ofNullable(WebUtils.getCredential(requestContext, UsernamePasswordCredential.class))
                    .ifPresent(credential -> bean.setCurrentPassword(credential   .getPassword()));

Reply all
Reply to author
Forward
0 new messages