Build a login approval system - Part 2: Building the backend