Skip to content

Commit

Permalink
refactor: [#446] fixed text formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-nt committed Feb 21, 2024
1 parent 4208f3a commit 3607dc9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/web/api/server/v1/extractors/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pub mod bearer_token;
pub mod optional_user_id;
pub mod user_id;
pub mod optional_user_id;
16 changes: 8 additions & 8 deletions src/web/api/server/v1/extractors/optional_user_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::sync::Arc;
use async_trait::async_trait;
use axum::extract::{FromRef, FromRequestParts};
use axum::http::request::Parts;
use axum::response::{ Response};
use axum::response::Response;

use crate::common::AppData;
use crate::models::user::UserId;
Expand All @@ -13,21 +13,21 @@ pub struct ExtractOptionalLoggedInUser(pub Option<UserId>);

#[async_trait]
impl<S> FromRequestParts<S> for ExtractOptionalLoggedInUser
where
Arc<AppData>: FromRef<S>,
S: Send + Sync,
where
Arc<AppData>: FromRef<S>,
S: Send + Sync,
{
type Rejection = Response;

async fn from_request_parts(parts: &mut Parts, state: &S) -> Result<Self, Self::Rejection> {
/* let maybe_bearer_token = match bearer_token::Extract::from_request_parts(parts, state).await {
/* let maybe_bearer_token = match bearer_token::Extract::from_request_parts(parts, state).await {
Ok(maybe_bearer_token) => maybe_bearer_token.0,
Err(_) => return Err(ServiceError::TokenNotFound.into_response()),
}; */

let bearer_token = match bearer_token::Extract::from_request_parts(parts, state).await {
Ok(bearer_token) => bearer_token.0,
Err(_) => None
let bearer_token = match bearer_token::Extract::from_request_parts(parts, state).await {
Ok(bearer_token) => bearer_token.0,
Err(_) => None,
};

//Extracts the app state
Expand Down

0 comments on commit 3607dc9

Please sign in to comment.