public async Task <CurrentLoginInformationsOutput> GetCurrentLoginInformationsAsync() { var output = new CurrentLoginInformationsOutput { User = (await GetCurrentUserAsync()).MapTo <UserLoginInfoDto>() }; if (InfrastructureSession.TenantId.HasValue) { output.Tenant = (await GetCurrentTenantAsync()).MapTo <TenantLoginInfoDto>(); } return(output); }
public CurrentLoginInformationsOutput GetCurrentLoginInformations() { var output = new CurrentLoginInformationsOutput { User = GetCurrentUser().MapTo <UserLoginInfoDto>() }; if (InfrastructureSession.TenantId.HasValue) { output.Tenant = GetCurrentTenant().MapTo <TenantLoginInfoDto>(); } return(output); }
public CurrentLoginInformationsOutput GetCurrentLoginInformations() { var output = new CurrentLoginInformationsOutput { Application = new ApplicationInfoOutput { Version = AppVersionHelper.Version, ReleaseDate = AppVersionHelper.ReleaseDate, Features = new Dictionary <string, bool>() } }; if (_contextAccessor.HttpContext.User.Identity?.IsAuthenticated == true) { string userDataJsonStr = _contextAccessor.HttpContext.User.Claims.Where(claim => claim.Type == ClaimTypes.UserData).FirstOrDefault().Value; output.User = JsonConvert.DeserializeObject <LoginUserOutput>(userDataJsonStr); } return(output); }