public static void CreateIdentity(MvcIdentityModel identity) { var computed = MvcIdentityModel.New(identity); computed.Password = SecurePassword.Hash(computed.Password); computed.Password2 = computed.Password; computed.Status = "active"; Database.Insert("identities", computed.ToDbModel()); }
public static MvcIdentityModel GetIdentityByToken(string token) { var dbIdentity = Database.GetOne <DatabaseIdentityModel>("identities", $"token = '{token}'"); return(MvcIdentityModel.New(dbIdentity)); }
public static MvcIdentityModel GetIdentityByUsername(string username) { var dbIdentity = Database.GetOne <DatabaseIdentityModel>("identities", $"username = '******'"); return(MvcIdentityModel.New(dbIdentity)); }
public static MvcIdentityModel GetIdentityByEmail(string email) { var dbIdentity = Database.GetOne <DatabaseIdentityModel>("identities", $"email = '{email}'"); return(MvcIdentityModel.New(dbIdentity)); }
public static MvcIdentityModel GetIdentityByGuid(Guid guid) { var dbIdentity = Database.GetOne <DatabaseIdentityModel>("identities", $"id = '{guid}'"); return(MvcIdentityModel.New(dbIdentity)); }