public async Task <IActionResult> ExternalLoginActive(ActiveWhenAccountIsExistModel model) { try { var result = await _customerAppService.ActiveWhenAccountIsExist(model); return(Json(result)); } catch (Exception e) { _logger.LogError(e, e.Message, Common.Common.GetMethodName()); throw; } }
public async Task <ActiveWhenAccountIsExistModel> ActiveWhenAccountIsExist(ActiveWhenAccountIsExistModel model) { try { var page = await base.InitPage(); model.SetInitInfo(page); var user = _currentContext.HttpContext.User; if (user == null || !user.Identities.Any(identity => identity.IsAuthenticated)) { model.AddMessage(ResourceKey.Account_ExternalLoginCallback_Fail); return(model); } var email = user.FindFirst(p => p.Type == ClaimTypes.Email)?.Value.Trim(); model.EmailOrMobile = email; return(model); } catch (Exception e) { _logger.LogError(e, e.Message); throw e; } }