From 1b5a5125a7164509274c900825beb1e557aeb328 Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Sat, 27 Jun 2026 22:14:10 -0400 Subject: [PATCH] Derive Ser/De on User and UserCredentials --- src/models/user.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/models/user.rs b/src/models/user.rs index ed99050..57a638d 100644 --- a/src/models/user.rs +++ b/src/models/user.rs @@ -1,8 +1,10 @@ //! Various user types. Some types marked server-only to help prevent //! leaking passwords to the frontend +use serde::{Deserialize, Serialize}; + /// Standard informational user type, contains no password information -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(feature = "server", derive(Queryable, Selectable, Identifiable))] #[cfg_attr(feature = "server", diesel(table_name = crate::schema::users, check_for_backend(diesel::pg::Pg)))] @@ -13,6 +15,7 @@ pub struct User { } /// Plaintext user credentials, used for login/signup form +#[derive(Deserialize, Serialize)] pub struct UserCredentials { pub username: String, pub password: String,