You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.3 KiB
34 lines
1.3 KiB
using Newtonsoft.Json;
|
|
|
|
namespace Models
|
|
{
|
|
// TODO: Do we want them to be able to log in with username?
|
|
// Could be nice, but adds complexity not worth at the moment
|
|
public class LoginDetails
|
|
{
|
|
// Email associated with an account
|
|
public string email;
|
|
// Plain text password, must be hashed (Argon2d) and compared against database
|
|
public string password;
|
|
// This is a Ed25519 public key which can be used to verify that
|
|
// a header was signed by a client. It will be included in the JWT
|
|
public string clientVerificationKey;
|
|
|
|
/// <summary>
|
|
/// Returns a string representation of the object but replaces all of the characters in password with *.
|
|
/// </summary>
|
|
/// <returns>A string representation of the object with password replaced by *</returns>
|
|
public override string ToString()
|
|
{
|
|
// Create a copy of the object so that we can modify its password field
|
|
var copy = (LoginDetails)this.MemberwiseClone();
|
|
|
|
// Replace the characters in the password field with asterisks
|
|
copy.password = new string('*', copy.password.Length);
|
|
|
|
// Return the string representation of the modified copy
|
|
return JsonConvert.SerializeObject(copy, Formatting.Indented);
|
|
}
|
|
}
|
|
|
|
} |