Added an authorization header bearer token extraction demo.
This commit is contained in:
@@ -5,7 +5,7 @@ use uuid::Uuid;
|
||||
|
||||
use super::{
|
||||
dtos::account::{AccountRequest, AccountResponse},
|
||||
extractors::{json::Json, path::Path, query::Query},
|
||||
extractors::{auth::Auth, json::Json, path::Path, query::Query},
|
||||
};
|
||||
use crate::{
|
||||
error::AppError,
|
||||
@@ -33,6 +33,7 @@ pub struct QueryParams {
|
||||
#[axum::debug_handler]
|
||||
#[tracing::instrument(skip(pool))]
|
||||
async fn list_accounts(
|
||||
Auth(auth): Auth,
|
||||
State(pool): State<PgPool>,
|
||||
Query(query): Query<QueryParams>,
|
||||
) -> Result<Json<Vec<AccountResponse>>, AppError> {
|
||||
|
||||
Reference in New Issue
Block a user