rave/src/rest/ping.rs

15 lines
377 B
Rust
Raw Normal View History

use poem::web::Data;
use sqlx::SqlitePool;
use crate::{authentication::Authentication, subsonic::SubsonicResponse, utils};
2023-10-08 19:53:42 +00:00
#[poem::handler]
pub async fn ping(Data(pool): Data<&SqlitePool>, auth: Authentication) -> SubsonicResponse {
let u = utils::verify_user(pool, auth).await;
2023-10-08 19:53:42 +00:00
match u {
Ok(_) => SubsonicResponse::new_empty(),
Err(e) => e,
}
2023-10-08 19:53:42 +00:00
}