Login code with popup