Store only username in messages.json to not leak data
parent
196a344376
commit
4c416cbee0
|
@ -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"
|
||||||
|
|
|
@ -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 date: DateTime<Utc> = Utc.ymd(year, month, day).and_hms(9, 10, 11);
|
||||||
let message_obj: Message = Message {
|
let message_obj: Message = Message {
|
||||||
id: Uuid::new_v4(),
|
id: Uuid::new_v4(),
|
||||||
user: user.to_owned(),
|
user: user.name.to_owned(),
|
||||||
body: message.body.to_string(),
|
body: message.body.to_string(),
|
||||||
created_at: date,
|
created_at: date,
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,7 +13,7 @@ pub struct MessageInput<'r> {
|
||||||
#[derive(Debug, Deserialize, Serialize, Clone)]
|
#[derive(Debug, Deserialize, Serialize, Clone)]
|
||||||
pub struct Message {
|
pub struct Message {
|
||||||
pub id: Uuid,
|
pub id: Uuid,
|
||||||
pub user: User,
|
pub user: String,
|
||||||
pub body: String,
|
pub body: String,
|
||||||
pub created_at: DateTime<Utc>,
|
pub created_at: DateTime<Utc>,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue