SEBWIN-621: Fixed race condition happening with OAuth2 token renewal.
This commit is contained in:
parent
1c42434b9a
commit
ef84456311
1 changed files with 2 additions and 1 deletions
|
@ -421,7 +421,6 @@ namespace SafeExamBrowser.Server
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var authorization = ("Authorization", $"Bearer {oauth2Token}");
|
|
||||||
var contentType = "application/json;charset=UTF-8";
|
var contentType = "application/json;charset=UTF-8";
|
||||||
var token = ("SEBConnectionToken", connectionToken);
|
var token = ("SEBConnectionToken", connectionToken);
|
||||||
|
|
||||||
|
@ -429,6 +428,8 @@ namespace SafeExamBrowser.Server
|
||||||
{
|
{
|
||||||
if (logContent.TryDequeue(out var c) && c is ILogMessage message)
|
if (logContent.TryDequeue(out var c) && c is ILogMessage message)
|
||||||
{
|
{
|
||||||
|
// IMPORTANT: The token needs to be read for every request, as it may get updated by another thread!
|
||||||
|
var authorization = ("Authorization", $"Bearer {oauth2Token}");
|
||||||
var json = new JObject
|
var json = new JObject
|
||||||
{
|
{
|
||||||
["type"] = message.Severity.ToLogType(),
|
["type"] = message.Severity.ToLogType(),
|
||||||
|
|
Loading…
Reference in a new issue