public async Task <IActionResult> AutoSignIn([FromBody] UserAutoSignInModel model) { if (!ModelState.IsValid) { return(BadRequest()); } return(Json(await _managerUserControl.AutoSignIn(model))); }
public async Task <UserStatusModel> AutoSignIn(UserAutoSignInModel model) { var provider = await _repositoryProvider.GetFirst(x => x.Slug == model.ProviderSlug && x.State == MREntityState.Active); if (provider == null) { _eNotFound("Provider not found"); } return(new UserStatusModel { CallbackToken = ProviderTokenGenerator.Generate(provider.Id, _userId), CallbackUrl = string.IsNullOrWhiteSpace(model.RedirectUrl) ? provider.Options.CallbackUrl : model.RedirectUrl }); }