PDS software with bells & whistles you didn’t even know you needed. will move this to its own account when ready.
at main 824 B view raw
1use crate::api::SuccessResponse; 2use crate::state::AppState; 3use axum::{ 4 Json, 5 extract::State, 6 response::{IntoResponse, Response}, 7}; 8use serde::Deserialize; 9 10#[derive(Deserialize)] 11#[serde(rename_all = "camelCase")] 12pub struct ConfirmChannelVerificationInput { 13 pub channel: String, 14 pub identifier: String, 15 pub code: String, 16} 17 18pub async fn confirm_channel_verification( 19 State(state): State<AppState>, 20 Json(input): Json<ConfirmChannelVerificationInput>, 21) -> Response { 22 let token_input = crate::api::server::VerifyTokenInput { 23 token: input.code, 24 identifier: input.identifier, 25 }; 26 27 match crate::api::server::verify_token_internal(&state, token_input).await { 28 Ok(_output) => SuccessResponse::ok().into_response(), 29 Err(e) => e.into_response(), 30 } 31}