feat: with authorization

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-05-27 13:12:29 +02:00
parent 1d4cda7c48
commit e991caef73
21 changed files with 2073 additions and 1186 deletions

View File

@@ -4,8 +4,6 @@ use como_domain::{
item::{
queries::{GetItemQuery, GetItemsQuery},
requests::CreateItemDto,
responses::CreatedItemDto,
ItemDto,
},
projects::{
queries::{GetProjectQuery, GetProjectsQuery},

View File

@@ -21,6 +21,14 @@ pub async fn graphql_handler(
Ok(schema.execute(req).await.into())
}
//fn get_token_from_headers(headers: &HeaderMap) -> Option<Token> {
// headers.get("Authorization").and_then(|value| {
// let value = value.to_str().ok()?;
// let value = value.strip_prefix("Bearer ")?;
// Some(Token(value.to_string()))
// })
//}
pub async fn graphql_playground() -> impl IntoResponse {
Html(playground_source(GraphQLPlaygroundConfig::new("/graphql")))
}