public async Task <IActionResult> SelectTenant(string rd) { var authResult = await HttpContext.AuthenticateAsync(Constants.ExternalCookieSchemeName); if (authResult.Succeeded) { var userTenants = _mapper.GetTenantsFor(authResult.Principal); switch (userTenants.Count()) { case 0: return(_frontend.NoTenantsForUser(HttpContext)); case 1: return(_tenantAuthenticator.SignUserInTo(HttpContext, userTenants.First(), rd)); default: return(_frontend.ChooseTenant(HttpContext)); } } return(Signin(rd)); }
public IActionResult Signin(string rd, Guid tenant) { return(_authenticator.SignUserInTo(HttpContext, tenant, rd)); }