You can't. It's not designed this way.
First off, the Mac keyboards aren't designed to have multiple pairings. If you want to swap between two machines, you need a keyboard and mouse with that capability. The same thing goes for the mouse.
Secondly, allowing the ability to do a Bluetooth pairing outside of an authenticated session is a major security flaw. This would allow an attacker to install any sort of device, including nefarious ones, without your consent. It's more than likely that in your use case scenario that would never happen because it's "just you" in your environment, but computer manufacturers don't implement security in one off environments.