mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 20:23:43 +08:00
feat: add new error response for 403 (#1330)
Co-authored-by: harsh_sharma_juspay <harsh.sharma@juspay.in> Co-authored-by: Sampras Lopes <lsampras@protonmail.com>
This commit is contained in:
@ -241,7 +241,7 @@ where
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct JWTAuth;
|
||||
pub(crate) struct JWTAuth;
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
struct JwtAuthPayloadFetchUnit {
|
||||
@ -315,19 +315,6 @@ impl ClientSecretFetch for api_models::cards_info::CardsInfoRequest {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn jwt_auth_or<'a, T: AuthInfo, A: AppStateInfo>(
|
||||
default_auth: &'a dyn AuthenticateAndFetch<T, A>,
|
||||
headers: &HeaderMap,
|
||||
) -> Box<&'a dyn AuthenticateAndFetch<T, A>>
|
||||
where
|
||||
JWTAuth: AuthenticateAndFetch<T, A>,
|
||||
{
|
||||
if is_jwt_auth(headers) {
|
||||
return Box::new(&JWTAuth);
|
||||
}
|
||||
Box::new(default_auth)
|
||||
}
|
||||
|
||||
pub fn get_auth_type_and_flow<A: AppStateInfo + Sync>(
|
||||
headers: &HeaderMap,
|
||||
) -> RouterResult<(
|
||||
|
||||
Reference in New Issue
Block a user