|
@@ -37,7 +37,7 @@ namespace TEAMModelOS.Filter
|
|
|
public void OnResourceExecuting(ResourceExecutingContext context)
|
|
|
{
|
|
|
bool pass = false;
|
|
|
- string id = string.Empty, name = string.Empty, picture = string.Empty, school = string.Empty;
|
|
|
+ string id = string.Empty, name = string.Empty, picture = string.Empty, school = string.Empty, standard=string.Empty;
|
|
|
var authtoken = context.HttpContext.GetXAuth("AuthToken");
|
|
|
if (!string.IsNullOrWhiteSpace(authtoken) && JwtAuthExtension.ValidateAuthToken(authtoken, _option.JwtSecretKey))
|
|
|
{
|
|
@@ -46,7 +46,7 @@ namespace TEAMModelOS.Filter
|
|
|
school = jwt.Payload.Azp;
|
|
|
name = jwt.Claims.FirstOrDefault(claim => claim.Type.Equals("name") )?.Value;
|
|
|
picture = jwt.Claims.FirstOrDefault(claim => claim.Type.Equals("picture"))?.Value;
|
|
|
-
|
|
|
+ standard = jwt.Claims.FirstOrDefault(claim => claim.Type.Equals("standard"))?.Value;
|
|
|
if (!string.IsNullOrWhiteSpace(_roles))
|
|
|
{
|
|
|
var roles = jwt.Claims.Where(c => c.Type .Equals("roles"));
|
|
@@ -79,6 +79,7 @@ namespace TEAMModelOS.Filter
|
|
|
context.HttpContext.Items.Add("Name", name);
|
|
|
context.HttpContext.Items.Add("Picture", picture);
|
|
|
context.HttpContext.Items.Add("School", school);
|
|
|
+ context.HttpContext.Items.Add("Standard", standard);
|
|
|
}
|
|
|
else
|
|
|
context.Result = new BadRequestResult();
|