Derive Ser/De on User and UserCredentials
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
//! Various user types. Some types marked server-only to help prevent
|
//! Various user types. Some types marked server-only to help prevent
|
||||||
//! leaking passwords to the frontend
|
//! leaking passwords to the frontend
|
||||||
|
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
/// Standard informational user type, contains no password information
|
/// 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", derive(Queryable, Selectable, Identifiable))]
|
||||||
#[cfg_attr(feature = "server", diesel(table_name = crate::schema::users,
|
#[cfg_attr(feature = "server", diesel(table_name = crate::schema::users,
|
||||||
check_for_backend(diesel::pg::Pg)))]
|
check_for_backend(diesel::pg::Pg)))]
|
||||||
@@ -13,6 +15,7 @@ pub struct User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Plaintext user credentials, used for login/signup form
|
/// Plaintext user credentials, used for login/signup form
|
||||||
|
#[derive(Deserialize, Serialize)]
|
||||||
pub struct UserCredentials {
|
pub struct UserCredentials {
|
||||||
pub username: String,
|
pub username: String,
|
||||||
pub password: String,
|
pub password: String,
|
||||||
|
|||||||
Reference in New Issue
Block a user