Hastic standalone https://hastic.io
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
656 B

use hastic::services::user_service;
3 years ago
3 years ago
use warp::filters::method::post;
use warp::http::HeaderValue;
3 years ago
use warp::hyper::Body;
3 years ago
use warp::{http::Response, Filter};
3 years ago
use warp::{Rejection, Reply};
3 years ago
use serde::Serialize;
3 years ago
use crate::api;
#[derive(Serialize)]
struct SigninResp {
3 years ago
token: user_service::AccessToken,
}
3 years ago
pub fn get_route() -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
return warp::path!("api" / "auth" / "signin")
.and(post())
.and(warp::body::json())
.map(|user: user_service::User| {
3 years ago
api::API::json(&SigninResp {
token: "asdad".to_string(),
})
3 years ago
});
3 years ago
}