Can change user password
This commit is contained in:
@@ -21,6 +21,12 @@ pub struct User {
|
||||
pub authorized_services: Option<Vec<ServiceID>>,
|
||||
}
|
||||
|
||||
impl User {
|
||||
pub fn verify_password<P: AsRef<[u8]>>(&self, pass: P) -> bool {
|
||||
verify_password(pass, &self.password)
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq for User {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.uid.eq(&other.uid)
|
||||
@@ -81,8 +87,8 @@ impl EntityManager<User> {
|
||||
|
||||
/// Update user information
|
||||
fn update_user<F>(&mut self, id: &UserID, update: F) -> bool
|
||||
where
|
||||
F: FnOnce(User) -> User,
|
||||
where
|
||||
F: FnOnce(User) -> User,
|
||||
{
|
||||
let user = match self.find_by_user_id(id) {
|
||||
None => return false,
|
||||
|
||||
Reference in New Issue
Block a user