diff --git a/Site5/App_Code/DataV5Base.cs b/Site5/App_Code/DataV5Base.cs index e197898b..484d8139 100644 --- a/Site5/App_Code/DataV5Base.cs +++ b/Site5/App_Code/DataV5Base.cs @@ -1,6 +1,7 @@ using System; using System.Globalization; using System.Web; +using System.Web.Security; using System.Web.UI; using Swarmops.Common.Enums; using Swarmops.Logic.Security; @@ -54,13 +55,13 @@ public class DataV5Base : Page { try { - CurrentAuthority = Authority.FromEncryptedXml(identity); + CurrentAuthority = CommonV5.GetAuthenticationDataAndCulture(HttpContext.Current).Authority; } catch (Exception) { - // if this fails FOR ANY REASON, we're unauthenticated - - CurrentAuthority = null; + // if this fails FOR WHATEVER REASON then we're not authenticated + this.CurrentAuthority = null; + FormsAuthentication.SignOut(); } } else diff --git a/Site5/Master-v5.master.cs b/Site5/Master-v5.master.cs index 23bb736f..173d3905 100644 --- a/Site5/Master-v5.master.cs +++ b/Site5/Master-v5.master.cs @@ -22,9 +22,18 @@ namespace Swarmops { protected void Page_Init (object sender, EventArgs e) { - this._authority = - AuthenticationData.FromAuthority (Authority.FromEncryptedXml (HttpContext.Current.User.Identity.Name)) - .Authority; + try + { + this._authority = CommonV5.GetAuthenticationDataAndCulture(HttpContext.Current).Authority; + } + catch (Exception) + { + // if this fails FOR WHATEVER REASON then we're not authenticated + + this._authority = null; + FormsAuthentication.SignOut(); + Response.Redirect("/"); + } } protected void Page_Load (object sender, EventArgs e)