Skip to content
Clone
a06673b
20 lines 595 B Rust
use axum::extract::State;
use crate::error::AuthError;
use crate::features::AuthService;
use crate::features::oauth::types::OAuthProviderInfo;
use export::data::AppResponseData;
#[utoipa::path(
get,
path = "/auth/oauth/providers",
tag = "auth",
responses(
(status = 200, description = "List of enabled OAuth providers.", body = AppResponseData<Vec<OAuthProviderInfo>>),
),
)]
pub(crate) async fn handler(
State(svc): State<AuthService>,
) -> Result<AppResponseData<Vec<OAuthProviderInfo>>, AuthError> {
Ok(AppResponseData::ok(svc.list_oauth_providers()))
}