Skip to content

Commit 9f95046

Browse files
committed
sending auth_token_requested call on token requested
1 parent b27d46b commit 9f95046

File tree

2 files changed

+18
-1
lines changed
  • tee-worker/identity/litentry/core

2 files changed

+18
-1
lines changed

tee-worker/identity/litentry/core/authentication/src/jwt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub struct Header {
4848
#[derive(Serialize, Deserialize, PartialEq, Debug)]
4949
pub struct Payload {
5050
sub: String,
51-
exp: BlockNumber,
51+
pub exp: BlockNumber,
5252
}
5353

5454
impl Payload {

tee-worker/identity/litentry/core/native-task/receiver/src/lib.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,23 @@ fn handle_trusted_call<ShieldingKeyRepository, AA, SES, OA, EF, NMR, AKR, AR, SH
582582
return
583583
};
584584

585+
let auth_token_requested_call = OpaqueCall::from_tuple(&compose_call!(
586+
&metadata,
587+
"OmniAccount",
588+
"auth_token_requested",
589+
omni_account,
590+
payload.exp
591+
));
592+
if let Ok(extrinsic) =
593+
context.extrinsic_factory.create_extrinsics(&[auth_token_requested_call], None)
594+
{
595+
if let Err(e) =
596+
context.ocall_api.send_to_parentchain(extrinsic, &ParentchainId::Litentry, None)
597+
{
598+
log::error!("Failed to send extrinsic to parentchain: {:?}", e);
599+
}
600+
}
601+
585602
let result: TrustedCallResult = Ok(auth_token.into());
586603
context.author_api.send_rpc_response(connection_hash, result.encode(), false);
587604
return

0 commit comments

Comments
 (0)