Add $token variable for retrieving authentication token claims data
This commit is contained in:
parent
a7444a7c8e
commit
0d4d2359d4
1 changed files with 8 additions and 4 deletions
|
@ -92,14 +92,18 @@ impl Session {
|
||||||
}
|
}
|
||||||
/// Convert a session into a runtime
|
/// Convert a session into a runtime
|
||||||
pub(crate) fn context<'a>(&self, mut ctx: Context<'a>) -> Context<'a> {
|
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
|
// Add auth data
|
||||||
let key = String::from("auth");
|
let key = String::from("auth");
|
||||||
let val: Value = self.sd.to_owned().into();
|
let val: Value = self.sd.to_owned().into();
|
||||||
ctx.add_value(key, val);
|
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
|
// Add session value
|
||||||
let key = String::from("session");
|
let key = String::from("session");
|
||||||
let val: Value = Value::from(map! {
|
let val: Value = Value::from(map! {
|
||||||
|
|
Loading…
Reference in a new issue