2020-11-29 13:59:59 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
2020-11-07 14:37:56 +00:00
|
|
|
/// RoomInfo has basic metadata about a room: its name, ID, etc.
|
2020-11-29 21:29:13 +00:00
|
|
|
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
|
2020-11-07 14:37:56 +00:00
|
|
|
pub struct RoomInfo {
|
|
|
|
pub room_id: String,
|
|
|
|
pub room_name: String,
|
|
|
|
}
|
2021-05-22 14:52:32 +00:00
|
|
|
|
|
|
|
#[derive(Eq, PartialEq, Debug)]
|
|
|
|
pub struct User {
|
|
|
|
pub username: String,
|
|
|
|
pub password: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl User {
|
|
|
|
pub fn verify_password(&self, raw_password: &str) -> bool {
|
|
|
|
argon2::verify_encoded(&self.password, raw_password.as_bytes()).unwrap_or(false)
|
|
|
|
}
|
|
|
|
}
|