move login function into FBSync