BLOG-86 Checking authentication before uploading image #101
1
backend/Cargo.lock
generated
1
backend/Cargo.lock
generated
@ -1664,6 +1664,7 @@ dependencies = [
|
|||||||
"actix-multipart",
|
"actix-multipart",
|
||||||
"actix-web",
|
"actix-web",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
"auth",
|
||||||
"futures",
|
"futures",
|
||||||
"log",
|
"log",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -11,3 +11,5 @@ futures.workspace = true
|
|||||||
log.workspace = true
|
log.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
sqlx.workspace = true
|
sqlx.workspace = true
|
||||||
|
|
||||||
|
auth.workspace = true
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use actix_multipart::Multipart;
|
use actix_multipart::Multipart;
|
||||||
use actix_web::{HttpResponse, Responder, web};
|
use actix_web::{HttpResponse, Responder, web};
|
||||||
|
use auth::framework::web::auth_middleware::UserId;
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -18,6 +19,7 @@ pub fn configure_image_routes(cfg: &mut web::ServiceConfig) {
|
|||||||
async fn upload_image_handler(
|
async fn upload_image_handler(
|
||||||
image_controller: web::Data<dyn ImageController>,
|
image_controller: web::Data<dyn ImageController>,
|
||||||
mut payload: Multipart,
|
mut payload: Multipart,
|
||||||
|
_: UserId,
|
||||||
) -> impl Responder {
|
) -> impl Responder {
|
||||||
let mut image_request_dto: Option<ImageRequestDto> = None;
|
let mut image_request_dto: Option<ImageRequestDto> = None;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user