Error executing template "Designs/Swift/_parsed/RTC-Account-Create-AxDw.parsed.cshtml"
System.InvalidOperationException: The current user is not authenticated.
   at CompiledRazorTemplates.Dynamic.RazorEngine_ed56d703ea1e47d9a55f840158cbf22b.Execute() in D:\dynamicweb.net\Solutions\Altex Holding\altexrtc.cloud.dynamicweb-cms.com\Files\Templates\Designs\Swift\_parsed\RTC-Account-Create-AxDw.parsed.cshtml:line 13
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 3 4 5 @using System.Web 6 @using Dynamicweb.Security.UserManagement 7 @using RTC.eCommerce.CreateCustomer 8 9 @{ 10 if (Pageview.User == null) { 11 throw new InvalidOperationException("The current user is not authenticated."); 12 } 13 if (!Pageview.User.GetCustomerFromSite()) { 14 throw new InvalidOperationException(string.Format("The user '{0}' doesn't have the CreateFromSite flag.", Pageview.User.ID)); 15 } 16 17 string error = null; 18 19 try 20 { 21 CustomerCreateFacade.Create(Pageview.User); 22 23 HttpContext.Current.Response.Redirect("/"); 24 } 25 catch (Exception ex) 26 { 27 error = ex.ToString(); 28 } 29 } 30 31 32 <div> 33 @if (!string.IsNullOrEmpty(error)) { 34 <p>@error</p> 35 } 36 </div> 37 38