public LoginViewModel Build()
        {
            var result = new LoginViewModel();

            var fieldViewModelBuilder = new FormFieldViewModelBuilder(
                _loginRouteConfiguration.Form.FieldOrder,
                _loginRouteConfiguration.Form.Fields,
                Stormpath.Configuration.Abstractions.Default.Configuration.Web.Login.Form.Fields);

            result.Form.Fields = fieldViewModelBuilder.Build().ToArray();

            // Social Providers
            result.AccountStores = _providerConfigurations.Select(x => new AccountStoreViewModel
            {
                Name     = x.Key,
                Href     = x.Value.CallbackUri,
                Provider = new AccountStoreProviderViewModel()
                {
                    Href       = x.Key,
                    ClientId   = x.Value.ClientId,
                    ProviderId = x.Key,
                    Scope      = x.Value.Scope
                }
            }).ToArray();

            return(result);
        }
Beispiel #2
0
        public RegisterViewModel Build()
        {
            var result = new RegisterViewModel();

            var fieldViewModelBuilder = new FormFieldViewModelBuilder(
                registerRouteConfiguration.Form.FieldOrder,
                registerRouteConfiguration.Form.Fields,
                Stormpath.Configuration.Abstractions.Default.Configuration.Web.Register.Form.Fields);

            result.Form.Fields = fieldViewModelBuilder.Build().ToArray();

            return(result);
        }