Add new subcomand for plm to reset password (#406)
* Add new subcomand for plm to reset password * Verify user exist before asking for new password
This commit is contained in:
committed by
Igor Galić
parent
dfa89e227a
commit
2333d898b9
@@ -381,6 +381,13 @@ impl User {
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
pub fn reset_password(&self, conn: &Connection, pass: &str) -> Result<()> {
|
||||
diesel::update(self)
|
||||
.set(users::hashed_password.eq(User::hash_pass(pass)?))
|
||||
.execute(conn)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn update_boxes(&self, conn: &Connection) -> Result<()> {
|
||||
let instance = self.get_instance(conn)?;
|
||||
if self.outbox_url.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user