1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
//! jwt login module
//! bind to [`crate::extensions::Extensions::JWTLogin`]
//!
//! | limit | yes/no |
//! | --- | --- |
//! | rate limit | yes |
//! | require auth | no |
//!
//! may return [`crate::error_code::ErrorCode::UnsupportedJWTLogin`] if the jwt
//! login is not supported.
use serde::{Deserialize, Serialize};
/// The jwt login request.
/// should use a valid JWT token.
///
/// may return [`crate::error_code::ErrorCode::InvalidJWTToken`] if the jwt
/// token is invalid.
///
/// | limit | yes/no |
/// | --- | --- |
/// | rate limit | yes |
/// | require auth | no |
///
/// POST `/auth/jwt_v1/login`
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct JwtLoginRequestV1 {
#[serde(flatten)]
pub header: Option<super::CommonLoginRequestHeader>,
pub jwt_token: String,
}
crate::impl_request!(JwtLoginRequestV1);
/// The jwt login response.
///
/// may return [`crate::error_code::ErrorCode::InvalidJWTToken`] if the jwt
/// token is invalid.
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct JwtLoginResponseV1 {}
crate::impl_response!(JwtLoginResponseV1);