This commit is contained in:
@@ -198,7 +198,7 @@ namespace AyaNova.Util
|
||||
cm.CommandText = "CREATE TABLE aschemaversion (schema INTEGER NOT NULL, id TEXT NOT NULL);";
|
||||
await cm.ExecuteNonQueryAsync();
|
||||
|
||||
cm.CommandText = $"insert into aschemaversion (schema, id) values (0,'{AyaNova.Util.Hasher.GenerateSalt()}');";
|
||||
cm.CommandText = $"insert into aschemaversion (schema, id) values (0,'{AyaNova.Util.Hasher.GenerateSalt()}');";//NOTE: this is where the dbid comes from originally
|
||||
await cm.ExecuteNonQueryAsync();
|
||||
|
||||
await ct.Database.CloseConnectionAsync();
|
||||
|
||||
@@ -26,8 +26,14 @@ namespace AyaNova.Util
|
||||
}
|
||||
|
||||
//Generate salt
|
||||
/*
|
||||
Used for many things:
|
||||
DBID, JWT secret key when none provided, User Salt for login / password,
|
||||
temporary 2fa codes, download tokens,
|
||||
temporary user pw / login when newly created and haven't been set yet
|
||||
*/
|
||||
public static string GenerateSalt()
|
||||
{
|
||||
{
|
||||
var salt = new byte[32];
|
||||
var random = RandomNumberGenerator.Create();
|
||||
random.GetNonZeroBytes(salt);
|
||||
|
||||
Reference in New Issue
Block a user