Updated the Login code so it responds with a set-cookie header for the session token. Still looking into if this is the right thing to do however.
This commit is contained in:
@@ -12,13 +12,13 @@ namespace SecureCore
|
||||
private static int SaltSize { get; } = 128 / 8; //128 bit salt
|
||||
private static int SessionKeySize { get; } = 32; //32 bytes
|
||||
|
||||
public static string CreateSessionId()
|
||||
public static string CreateSessionToken()
|
||||
{
|
||||
var sessionId = new byte[SessionKeySize];
|
||||
var token = new byte[SessionKeySize];
|
||||
|
||||
GetRandomBytes(ref sessionId);
|
||||
GetRandomBytes(ref token);
|
||||
|
||||
return Convert.ToBase64String(sessionId);
|
||||
return Convert.ToBase64String(token);
|
||||
}
|
||||
|
||||
public static (string Hash, string Salt) HashPassword(string password)
|
||||
|
||||
Reference in New Issue
Block a user