Skip to content

Commit 95afbc8

Browse files
refactor: moar cleanup
1 parent d8565f1 commit 95afbc8

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

backend/src/routing/middleware.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,26 @@ pub async fn verify_jwt_middleware(
2525
if let Ok(auth) = auth {
2626
// If auth is fine, add it to the request extensions
2727
request.extensions_mut().insert(auth);
28+
Ok(next.run(request).await)
2829
} else {
29-
return Ok(BackendResponse::<()>::error(
30+
Ok(BackendResponse::<()>::error(
3031
"Authorization token invalid.".into(),
3132
StatusCode::UNAUTHORIZED,
3233
)
33-
.into_response());
34+
.into_response())
3435
}
3536
} else {
36-
return Ok(BackendResponse::<()>::error(
37+
Ok(BackendResponse::<()>::error(
3738
"Authorization header format invalid.".into(),
3839
StatusCode::UNAUTHORIZED,
3940
)
40-
.into_response());
41+
.into_response())
4142
}
4243
} else {
43-
return Ok(BackendResponse::<()>::error(
44+
Ok(BackendResponse::<()>::error(
4445
"Authorization header missing.".into(),
4546
StatusCode::UNAUTHORIZED,
4647
)
47-
.into_response());
48+
.into_response())
4849
}
49-
50-
Ok(next.run(request).await)
5150
}

0 commit comments

Comments
 (0)