More work on client side login and linking accounts