Complete login, logout and register functionality.