public static async Task LoginAsync(string username, string password) { try { var identity = await PTIdentity.GetPTIdentityAsync(username, password); SetPrincipal(identity); } catch (Exception ex) { Logout(); } }
public static async Task <bool> LoadAsync(string username) { var current = Csla.ApplicationContext.User; if (current != null && current.Identity != null && current.Identity.Name == username) { return(true); } var identity = await PTIdentity.GetPTIdentityAsync(username); return(SetPrincipal(identity)); }
public static async System.Threading.Tasks.Task LoginAsync(string username, string password) { try { var identity = await PTIdentity.GetPTIdentityAsync(username, password); SetPrincipal(identity); } catch { Logout(); } }