Login v2

@mimming This is the update

@davideast Can you pull this and make sure it works?