Create UserCredentials struct

This commit is contained in:
Ethan Girouard 2024-04-02 01:33:24 -04:00
parent 3a34e8dada
commit 7023e27b51
Signed by: eta357
GPG Key ID: 7BCDC36DFD11C146

View File

@ -14,8 +14,15 @@ cfg_if::cfg_if! {
} }
use leptos::*; use leptos::*;
use serde::{Serialize, Deserialize};
use crate::models::User; use crate::models::User;
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct UserCredentials {
pub username_or_email: String,
pub password: String
}
/// Get a user from the database by username or email /// Get a user from the database by username or email
/// Returns a Result with the user if found, None if not found, or an error if there was a problem /// Returns a Result with the user if found, None if not found, or an error if there was a problem
#[cfg(feature = "ssr")] #[cfg(feature = "ssr")]