Skip to content

Commit f4dae83

Browse files
committed
Remove discrod hook from change_password rpc
1 parent a9b515f commit f4dae83

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/rpc/auth/change_password.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
use crate::db;
2-
use crate::db::conf::schema::Conf;
3-
use crate::service::discord;
42
use crate::Result;
53
use argon2::PasswordHasher;
64
use argon2::PasswordVerifier;
@@ -24,7 +22,7 @@ pub struct Res {
2422
pub time_ms: i128,
2523
}
2624

27-
pub async fn run(params: Params, pool: &Pool, conf: &Conf) -> Result<Res> {
25+
pub async fn run(params: Params, pool: &Pool) -> Result<Res> {
2826
let error_cause_mask = "Something went wrong, please contact administrator";
2927
let start_time = OffsetDateTime::now_utc();
3028
let user = db::user::queries::select_by_name(params.username, pool)
@@ -41,11 +39,6 @@ pub async fn run(params: Params, pool: &Pool, conf: &Conf) -> Result<Res> {
4139
.to_string();
4240
db::user::queries::set_password(user.id, password_hash, pool).await?;
4341
let time_passed_ms = (OffsetDateTime::now_utc() - start_time).whole_milliseconds();
44-
let discord_message = format!(
45-
"User {} changed their password ({time_passed_ms} ms)",
46-
user.name,
47-
);
48-
discord::send(discord_message, discord::Channel::Api, conf);
4942
Ok(Res {
5043
time_ms: time_passed_ms,
5144
})

src/rpc/handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ pub async fn handle(
496496
),
497497
RpcMethod::ChangePassword => RpcResponse::from(
498498
req.id.clone(),
499-
super::auth::change_password::run(params(req.params)?, &pool, &conf).await?,
499+
super::auth::change_password::run(params(req.params)?, &pool).await?,
500500
),
501501
RpcMethod::AddAdminAction => RpcResponse::from(
502502
req.id.clone(),

0 commit comments

Comments
 (0)