Fixed broken auth system.
This commit is contained in:
parent
7a829d347b
commit
71d05f51ec
1 changed files with 2 additions and 2 deletions
|
|
@ -502,8 +502,8 @@ namespace TShockAPI
|
|||
/// <returns>string sha256</returns>
|
||||
public static string HashPassword(string password)
|
||||
{
|
||||
if (string.IsNullOrEmpty(password))
|
||||
throw new NullReferenceException("Password can not be null/empty");
|
||||
if (string.IsNullOrEmpty(password) || password == "non-existant password")
|
||||
return "non-existant password";
|
||||
var bytes = HashAlgo.ComputeHash(Encoding.ASCII.GetBytes(password));
|
||||
return bytes.Aggregate("", (s, b) => s + b.ToString("X2"));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue