Updated login

Login is now independant from the rest and can be reused in other
projects