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>
|
/// <returns>string sha256</returns>
|
||||||
public static string HashPassword(string password)
|
public static string HashPassword(string password)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(password))
|
if (string.IsNullOrEmpty(password) || password == "non-existant password")
|
||||||
throw new NullReferenceException("Password can not be null/empty");
|
return "non-existant password";
|
||||||
var bytes = HashAlgo.ComputeHash(Encoding.ASCII.GetBytes(password));
|
var bytes = HashAlgo.ComputeHash(Encoding.ASCII.GetBytes(password));
|
||||||
return bytes.Aggregate("", (s, b) => s + b.ToString("X2"));
|
return bytes.Aggregate("", (s, b) => s + b.ToString("X2"));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue