Changeset View
Changeset View
Standalone View
Standalone View
services/identity/src/grpc_services/authenticated.rs
Show First 20 Lines • Show All 392 Lines • ▼ Show 20 Lines | self | ||||
.await | .await | ||||
.map_err(handle_db_error)?; | .map_err(handle_db_error)?; | ||||
Ok(Response::new(Empty {})) | Ok(Response::new(Empty {})) | ||||
} | } | ||||
async fn link_farcaster_account( | async fn link_farcaster_account( | ||||
&self, | &self, | ||||
_request: tonic::Request<LinkFarcasterAccountRequest>, | request: tonic::Request<LinkFarcasterAccountRequest>, | ||||
) -> Result<Response<Empty>, tonic::Status> { | ) -> Result<Response<Empty>, tonic::Status> { | ||||
unimplemented!(); | let (user_id, _) = get_user_and_device_id(&request)?; | ||||
let message = request.into_inner(); | |||||
self | |||||
.db_client | |||||
.add_farcaster_id(user_id, message.farcaster_id) | |||||
.await | |||||
.map_err(handle_db_error)?; | |||||
let response = Empty {}; | |||||
Ok(Response::new(response)) | |||||
} | } | ||||
} | } | ||||
// raw device list that can be serialized to JSON (and then signed in the future) | // raw device list that can be serialized to JSON (and then signed in the future) | ||||
#[derive(serde::Serialize, serde::Deserialize)] | #[derive(serde::Serialize, serde::Deserialize)] | ||||
struct RawDeviceList { | struct RawDeviceList { | ||||
devices: Vec<String>, | devices: Vec<String>, | ||||
timestamp: i64, | timestamp: i64, | ||||
▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines |