public async Task <IActionResult> Login(AuthenticateReq model)
        {
            try
            {
                if (String.IsNullOrEmpty(model.Username) || String.IsNullOrEmpty(model.Password))
                {
                    return(BadRequest(new
                    {
                        message = "Tên đăng nhập, mật khẩu không hợp lệ."
                    }));
                }
                else
                {
                    var lst = await _accountService.FindAsync(() => Builders <AccountModel> .Filter.Eq("Username", model.Username)& Builders <AccountModel> .Filter.Eq("Password", model.Password));

                    if (lst == null || lst.Count() == 0)
                    {
                        return(BadRequest(new
                        {
                            message = "Tài khoản hoặc mật khẩu không đúng."
                        }));
                    }

                    AccountModel account = lst.Where(i => i.IsActive == true).FirstOrDefault();
                    string       token   = GenerateJwtToken(account.Username, account.Role);

                    PageTokenModel pageToken = null;
                    if (account.PageTokens == null || account.PageTokens.Count == 0)
                    {
                        return(Ok(new
                        {
                            UserName = account.Username,
                            Role = account.Role,
                            IsReady = false,
                            AccessToken = token
                        }));
                    }

                    pageToken = account.PageTokens.FirstOrDefault();
                    return(Ok(new
                    {
                        UserName = account.Username,
                        Role = account.Role,
                        IsReady = pageToken == null ? false : pageToken.IsValid,
                        AccessToken = token
                    }));
                }
            }
            catch (Exception ex)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }
        public JsonResult getPageAccessPoint(string accessToken)
        {
            System.Diagnostics.Debug.WriteLine(accessToken);
            List <DataPageToken> dataList = new List <DataPageToken>();

            restClient.endpoint = facebookEndpoint.getPageAccessPoint(accessToken);

            string response = restClient.makeRequest(RestClient.HttpVerb.GET);

            PageTokenModel deserializedfbModel = new PageTokenModel();

            deserializedfbModel = JsonConvert.DeserializeObject <PageTokenModel>(response);
            foreach (DataPageToken d in deserializedfbModel.data)
            {
                dataList.Add(d);
            }
            return(Json(new { success = true, dataList = dataList }, JsonRequestBehavior.AllowGet));
        }