More fixes for invalid auth coookies
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user