mirror of
https://github.com/TECHNOFAB11/jwt-authorizer.git
synced 2025-12-11 23:50:07 +01:00
fix(jwt source): cookie from request (#18)
- JwtSource:Bearer renamed to AuthorizationHeader for more consistency with jwt terminology - documentation added - the token cookie should be taken from request not from the tower-cookies middleware jar - dependency on tower-cookies is no longer needed - tests added
This commit is contained in:
parent
3292d59d1c
commit
bad5ad18f3
5 changed files with 74 additions and 58 deletions
|
|
@ -9,7 +9,7 @@ use std::{
|
|||
};
|
||||
|
||||
use axum::{response::Response, routing::get, Json, Router};
|
||||
use http::{Request, StatusCode};
|
||||
use http::{header::AUTHORIZATION, Request, StatusCode};
|
||||
use hyper::Body;
|
||||
use jwt_authorizer::{JwtAuthorizer, JwtClaims, Refresh, RefreshStrategy};
|
||||
use lazy_static::lazy_static;
|
||||
|
|
@ -129,7 +129,7 @@ async fn make_proteced_request(app: &mut Router, bearer: &str) -> Response {
|
|||
.call(
|
||||
Request::builder()
|
||||
.uri("/protected")
|
||||
.header("Authorization", format!("Bearer {bearer}"))
|
||||
.header(AUTHORIZATION.as_str(), format!("Bearer {bearer}"))
|
||||
.body(Body::empty())
|
||||
.unwrap(),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue