Add login/logout logic.