Login and facebook login logic