blob: c2d97f2154893676ba808a9cbb340ece4379d0d9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
use axum::{extract::FromRequestParts, http::request::Parts};
use super::Login;
use crate::{app::App, token::extract::Identity};
#[async_trait::async_trait]
impl FromRequestParts<App> for Login {
type Rejection = <Identity as FromRequestParts<App>>::Rejection;
async fn from_request_parts(parts: &mut Parts, state: &App) -> Result<Self, Self::Rejection> {
let identity = Identity::from_request_parts(parts, state).await?;
Ok(identity.login)
}
}
|