22 lines
501 B
Rust
22 lines
501 B
Rust
use axum::debug_handler;
|
|
|
|
use crate::{
|
|
api::{description::AUTH_TAG, routes::AuthBackendType},
|
|
errors::ApiError,
|
|
};
|
|
|
|
#[debug_handler]
|
|
#[utoipa::path(
|
|
post,
|
|
path = "/logout",
|
|
summary = "Logout",
|
|
description = "Log the currently logged in user out.",
|
|
responses(
|
|
(status = OK, description = "Logout successful")
|
|
),
|
|
tag = AUTH_TAG)]
|
|
pub async fn logout(mut auth_session: AuthBackendType) -> Result<(), ApiError> {
|
|
auth_session.logout().await?;
|
|
Ok(())
|
|
}
|