public static void InitGUIDs(this OnionUser user) { user.GUID = Guid.NewGuid(); user.EmailConfirmationGUID = Guid.NewGuid(); user.PasswordSaltGUID = Guid.NewGuid(); user.RecoveryGUID = Guid.NewGuid(); }
public static bool CheckPassword(this OnionUser user, string password) { string stringToHash = password + user.PasswordSaltGUID.ToString(); if (user.Password == stringToHash.CreateMD5()) { return(true); } else { return(false); } }
public static void SetPassword(this OnionUser user, string password) { string stringToHash = password + user.PasswordSaltGUID.ToString(); user.Password = stringToHash.CreateMD5(); }