Add bcrypt password hashing and user gender handling in yourchat2
Integrated bcrypt for password verification and updated user profile management to include gender and rights handling. Enhanced room access validation to consider gender restrictions and user rights. Updated database queries and structures to support new fields, ensuring compatibility with existing functionalities.
This commit is contained in:
@@ -15,8 +15,10 @@ pub(crate) struct ClientConn {
|
||||
pub(crate) token: Option<String>,
|
||||
pub(crate) falukant_user_id: Option<i32>,
|
||||
pub(crate) chat_user_id: Option<i32>,
|
||||
pub(crate) gender_id: Option<i32>,
|
||||
pub(crate) age: Option<i32>,
|
||||
pub(crate) rights: HashSet<String>,
|
||||
pub(crate) right_type_ids: HashSet<i32>,
|
||||
pub(crate) logged_in: bool,
|
||||
pub(crate) tx: mpsc::UnboundedSender<String>,
|
||||
}
|
||||
@@ -43,8 +45,10 @@ pub(crate) struct UserProfile {
|
||||
pub(crate) color: Option<String>,
|
||||
pub(crate) falukant_user_id: Option<i32>,
|
||||
pub(crate) chat_user_id: Option<i32>,
|
||||
pub(crate) gender_id: Option<i32>,
|
||||
pub(crate) age: Option<i32>,
|
||||
pub(crate) rights: HashSet<String>,
|
||||
pub(crate) right_type_ids: HashSet<i32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
@@ -83,6 +87,8 @@ pub(crate) struct DiceGame {
|
||||
pub(crate) struct RoomMeta {
|
||||
pub(crate) name: String,
|
||||
pub(crate) password: Option<String>,
|
||||
pub(crate) gender_restriction_id: Option<i32>,
|
||||
pub(crate) required_user_right_id: Option<i32>,
|
||||
pub(crate) min_age: Option<i32>,
|
||||
pub(crate) max_age: Option<i32>,
|
||||
pub(crate) is_public: bool,
|
||||
|
||||
Reference in New Issue
Block a user