|
@@ -13,6 +13,7 @@ pub struct User {
|
|
|
pub email: String,
|
|
pub email: String,
|
|
|
pub password_hash: String,
|
|
pub password_hash: String,
|
|
|
pub password_salt: String,
|
|
pub password_salt: String,
|
|
|
|
|
+ pub encryption_salt: String,
|
|
|
pub created_at: bson::DateTime
|
|
pub created_at: bson::DateTime
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -20,6 +21,7 @@ pub struct User {
|
|
|
pub struct ResponseUser {
|
|
pub struct ResponseUser {
|
|
|
id: String,
|
|
id: String,
|
|
|
email: String,
|
|
email: String,
|
|
|
|
|
+ encryption_salt: String,
|
|
|
created_at: i64,
|
|
created_at: i64,
|
|
|
accounts: Option<Vec<ResponseAccount>>
|
|
accounts: Option<Vec<ResponseAccount>>
|
|
|
}
|
|
}
|
|
@@ -31,6 +33,7 @@ impl User {
|
|
|
email: input.email,
|
|
email: input.email,
|
|
|
password_hash: input.password_hash,
|
|
password_hash: input.password_hash,
|
|
|
password_salt: input.password_salt,
|
|
password_salt: input.password_salt,
|
|
|
|
|
+ encryption_salt: input.encryption_salt,
|
|
|
created_at: DateTime::now()
|
|
created_at: DateTime::now()
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -60,6 +63,7 @@ impl User {
|
|
|
ResponseUser {
|
|
ResponseUser {
|
|
|
id: self.id.to_string(),
|
|
id: self.id.to_string(),
|
|
|
email: self.email.clone(),
|
|
email: self.email.clone(),
|
|
|
|
|
+ encryption_salt: self.encryption_salt.clone(),
|
|
|
created_at: self.created_at.timestamp_millis(),
|
|
created_at: self.created_at.timestamp_millis(),
|
|
|
accounts: accounts
|
|
accounts: accounts
|
|
|
}
|
|
}
|