AppFlowy/rust-lib/flowy-user/src/handlers/auth.rs

19 lines
511 B
Rust
Raw Normal View History

2021-07-05 08:54:41 +00:00
use crate::domain::{User, UserCheck, UserEmail, UserName};
use flowy_sys::prelude::*;
use std::convert::TryInto;
// tracing instrument 👉🏻 https://docs.rs/tracing/0.1.26/tracing/attr.instrument.html
#[tracing::instrument(
name = "User check",
skip(data),
fields(
email = %data.email,
name = %data.name
)
)]
2021-07-05 08:54:41 +00:00
pub async fn user_check(data: Data<UserCheck>) -> ResponseResult<User, String> {
let user: User = data.into_inner().try_into().unwrap();
2021-07-05 08:54:41 +00:00
response_ok(user)
}