nickserv: add SET (password/email) and DROP
SET PASSWORD changes your password (derived off-thread like register) and SET EMAIL sets an address. DROP deletes your account, releases and drops the channels you founded, and logs you out. A dropped account federates, and each node logs out any local session that was relying on it.
This commit is contained in:
parent
0427819f86
commit
ef89f97158
9 changed files with 249 additions and 23 deletions
|
|
@ -54,6 +54,15 @@ pub async fn run(mut proto: Box<dyn Protocol>, engine: Arc<Mutex<Engine>>, addr:
|
|||
}
|
||||
}
|
||||
}
|
||||
// Password change: same off-thread derivation as register.
|
||||
NetAction::DeferPassword { account, password, agent, uid } => {
|
||||
let iterations = engine.lock().await.scram_iterations();
|
||||
let creds = tokio::task::spawn_blocking(move || {
|
||||
Db::derive_credentials(&password, iterations)
|
||||
})
|
||||
.await?;
|
||||
engine.lock().await.complete_password_change(&account, creds, &agent, &uid)
|
||||
}
|
||||
action => vec![action],
|
||||
};
|
||||
for act in outs {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue