More work on the login functions.