Revamps login to seperate login and authentication.