From 0d4d2359d4f0eeaf355a81725edd29d2f5bf1b7f Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Sat, 17 Sep 2022 02:44:11 +0100 Subject: [PATCH] Add $token variable for retrieving authentication token claims data --- lib/src/dbs/session.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/src/dbs/session.rs b/lib/src/dbs/session.rs index 954482bb..c31223aa 100644 --- a/lib/src/dbs/session.rs +++ b/lib/src/dbs/session.rs @@ -92,14 +92,18 @@ impl Session { } /// Convert a session into a runtime pub(crate) fn context<'a>(&self, mut ctx: Context<'a>) -> Context<'a> { - // Add scope value - let key = String::from("scope"); - let val: Value = self.sc.to_owned().into(); - ctx.add_value(key, val); // Add auth data let key = String::from("auth"); let val: Value = self.sd.to_owned().into(); ctx.add_value(key, val); + // Add scope data + let key = String::from("scope"); + let val: Value = self.sc.to_owned().into(); + ctx.add_value(key, val); + // Add token data + let key = String::from("token"); + let val: Value = self.tk.to_owned().into(); + ctx.add_value(key, val); // Add session value let key = String::from("session"); let val: Value = Value::from(map! {