Complete Login Logic.