Esempio n. 1
0
        /// <summary>
        /// 第三方账号注册或绑定
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task <AjaxResponse> ExternalRegisterOrBind(ExternalRegisterModel model)
        {
            if (!ModelState.IsValid)
            {
                throw new UserFriendlyException("Invalid request!");
            }

            //后续需要校验第三方服务

            var loginResult = await _logInManager.ExternalRegisterOrBind(model.UserName, model.LoginProvider, model.ProviderKey);

            string token = GetToken(loginResult);

            return(new AjaxResponse(token));
        }