According to Apple, it's not possible. The other way is to turn off the display and set require password in the System Prefrences. https://support.apple.com/en-us/HT201236
It still works, but I had to restart my computer before it would work again. ¯\_(ツ
