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.

27 lines
632 B

use hastic::services::user_service;
3 years ago
use warp::http::HeaderValue;
3 years ago
use warp::hyper::Body;
3 years ago
use warp::{Rejection, Reply};
use warp::filters::method::post;
use warp::{Filter, http::Response };
use serde::{ Serialize };
3 years ago
use crate::api;
#[derive(Serialize)]
struct SigninResp {
token: user_service::AccessToken
}
3 years ago
3 years ago
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
});
}