[Stuart and Sam] Start testing and fixing up the server-side auth code.