Store only username in messages.json to not leak data

pull/5/head
~erin 2021-07-22 11:52:29 -04:00
parent 196a344376
commit 4c416cbee0
Signed by: erin
GPG Key ID: DA70E064A8C70F44
3 changed files with 3 additions and 3 deletions

View File

@ -1 +1 @@
http POST 'http://localhost:8000/api/users/change' name=erin pin=10 changed_event=pin new_event=69
http POST 'http://localhost:8000/api/message/send' name=erin body="nyaa uwu" date="2021-07-21"

View File

@ -47,7 +47,7 @@ fn create_message(message: Json<MessageInput>, file: &str, user: &User) -> JsonV
let date: DateTime<Utc> = Utc.ymd(year, month, day).and_hms(9, 10, 11);
let message_obj: Message = Message {
id: Uuid::new_v4(),
user: user.to_owned(),
user: user.name.to_owned(),
body: message.body.to_string(),
created_at: date,
};

View File

@ -13,7 +13,7 @@ pub struct MessageInput<'r> {
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct Message {
pub id: Uuid,
pub user: User,
pub user: String,
pub body: String,
pub created_at: DateTime<Utc>,
}