Just need 1 instance of the generic principal.
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Wed, 9 Feb 2011 00:12:28 +0000 (19:12 -0500)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Wed, 9 Feb 2011 00:12:28 +0000 (19:12 -0500)
mcs/class/System.Web/System.Web.Security/DefaultAuthenticationModule.cs

index ba58d6bca46285d5199e6829f96ea5a8d8de8d5f..c2cf4b9cb9d1bb142cc629ea6f8a34ea4768d59a 100644 (file)
@@ -41,7 +41,7 @@ namespace System.Web.Security
        public sealed class DefaultAuthenticationModule : IHttpModule
        {
                static readonly object authenticateEvent = new object ();
-               static GenericIdentity defaultIdentity = new GenericIdentity ("", "");
+               static IPrincipal generic_principal = new GenericPrincipal (new GenericIdentity ("", ""), new string [0]);
 
                EventHandlerList events = new EventHandlerList ();
                
@@ -74,7 +74,7 @@ namespace System.Web.Security
                                eh (this, new DefaultAuthenticationEventArgs (context));
 
                        if (context.User == null)
-                               context.User = new GenericPrincipal (defaultIdentity, new string [0]);
+                               context.User = generic_principal;
 
                        Thread.CurrentPrincipal = context.User;
                }