After the remote operation is over, if you want to automatically lock the computer when disconnecting to prevent others from being operated, you can turn on the lock device option.

Lock Device

When this option is turned on, the recipient device will automatically lock when the remote connection is disconnected.  This option is only available for assigned devices and suitable for remote control of your own devices.