@ POST @ Path ( "{id}/password" ) @ PermitAll public Response changePassword ( @ PathParam ( "id" ) Long userId , PasswordRequest request ) { checkNotNull ( userId ) ; checkNotNull ( request . getToken ( ) ) ; checkPasswordFormat ( request . getNewPassword ( ) ) ; boolean isSuccess = userService . confirmResetPasswordUsingToken ( userId , request . getNewPassword ( ) , request . getToken ( ) ) ; return isSuccess ? Response . noContent ( ) . build ( ) : Response . status ( Response . Status . BAD_REQUEST ) . build ( ) ; }
Change password using a temporary token . Used during password reset flow .