Our Personal Data Server from scratch!
0

Configure Feed

Select the types of activity you want to include in your feed.

tranquil-pds / crates / tranquil-api / src / verification.rs
854 B 31 lines
1use axum::{ 2 Json, 3 extract::State, 4 response::{IntoResponse, Response}, 5}; 6use serde::Deserialize; 7use tranquil_pds::api::SuccessResponse; 8use tranquil_pds::state::AppState; 9 10#[derive(Deserialize)] 11#[serde(rename_all = "camelCase")] 12pub struct ConfirmChannelVerificationInput { 13 pub channel: tranquil_db_traits::CommsChannel, 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::server::VerifyTokenInput { 23 token: input.code, 24 identifier: input.identifier, 25 }; 26 27 match crate::server::verify_token_internal(&state, token_input).await { 28 Ok(_output) => SuccessResponse::ok().into_response(), 29 Err(e) => e.into_response(), 30 } 31}