More login logic, still not working fully