B:BD[
4.1556] → [
4.1556:2252]
let stmt = match dbclient
.prepare("delete from auth.reset_tokens where token = $1 and player_name = $2;")
.await
{
Ok(stmt) => stmt,
Err(e) => {
log::error!("Pool RW statement delete error {}", e);
return HttpResponse::ServiceUnavailable().body(actix_web::body::None::new());
}
};
let deleted = match dbclient.execute(&stmt, &[&form.token, &form.login]).await {
Ok(c) => c,
Err(e) => {
log::error!("Pool RW execute delete error {}", e);
return HttpResponse::ServiceUnavailable().body(actix_web::body::None::new());
if !cached_token.is_nil() {
let stmt = match dbclient
.prepare("delete from auth.reset_tokens where token = $1 and player_name = $2;")
.await
{
Ok(stmt) => stmt,
Err(e) => {
log::error!("Pool RW statement delete error {}", e);
return HttpResponse::ServiceUnavailable().body(actix_web::body::None::new());
}
};
let deleted = match dbclient
.execute(&stmt, &[&cached_token, &cached_login])
.await
{
Ok(c) => c,
Err(e) => {
log::error!("Pool RW execute delete error {}", e);
return HttpResponse::ServiceUnavailable().body(actix_web::body::None::new());
}
};
if deleted == 0 {
log::error!("Not delete error: {}", cached_token);
return HttpResponse::BadRequest().body("Incorrect");