Example #1
0
        public static void Logout()
        {
            var identity  = PhuLiIdentity.UnauthenticatedIdentity();
            var principal = new PhuLiPrincipal(identity);

            ApplicationContext.User = principal;
        }
Example #2
0
 private static bool SetPrincipal(PhuLiIdentity identity)
 {
     if (identity.IsAuthenticated)
     {
         var principal = new PhuLiPrincipal(identity);
         ApplicationContext.User = principal;
     }
     return(identity.IsAuthenticated);
 }
Example #3
0
 public static bool MobileLogin()
 {
     return(SetPrincipal(PhuLiIdentity.GetMobileIdentity()));
 }
Example #4
0
 public static bool Login()
 {
     return(SetPrincipal(PhuLiIdentity.GetIdentity()));
 }