This commit is contained in:
2022-03-04 20:24:42 +00:00
parent ba8e447f6a
commit 353a6072be
3 changed files with 12 additions and 7 deletions

View File

@@ -492,10 +492,15 @@ namespace AyaNova
//check if token has j value set
if (context.Request.IsLocal())
{
if (context.User.Claims.FirstOrDefault(c => c.Type == "j") != null)
//if this is a generate report internal token this will be the override language set
//and it's existance is enough to indicate it was set internally by this server
var rpl=context.User.Claims.FirstOrDefault(c => c.Type == "rpl");
if ( rpl!= null)
{
//it's a local request, the jwt already passed earlier so we issued it and it has the correct claim set so allow it
bLocalReportRenderRequest = true;
//set override language
context.Request.HttpContext.Items["AY_TRANSLATION_ID"]=Convert.ToInt64(rpl.Value);
await next.Invoke();
}
}