New JWT implementation
This commit is contained in:
parent
6692df9aeb
commit
dfb881f2ba
@ -1,4 +1,4 @@
|
||||
use actix_web::dev::ServiceRequest;
|
||||
use actix_web::{dev::ServiceRequest, HttpResponse};
|
||||
use actix_web::HttpMessage;
|
||||
use jsonwebtoken::{decode, DecodingKey, Validation};
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
@ -29,6 +29,10 @@ impl actix_web::ResponseError for Error {
|
||||
_ => actix_web::http::StatusCode::UNAUTHORIZED,
|
||||
}
|
||||
}
|
||||
|
||||
fn error_response(&self) -> actix_web::HttpResponse<actix_web::body::BoxBody> {
|
||||
HttpResponse::build(self.status_code()).body("")
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Authenticated<T>(Arc<T>);
|
||||
|
Loading…
Reference in New Issue
Block a user