Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Knossos.NET/Models/Nebula.cs
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,13 @@ private enum ApiMethod
}
else
{
/* Nebula responds with a HTTP status code 401 for expired tokens, so lets try this again */
if(needsLogIn && apiUserToken != null && response.StatusCode == System.Net.HttpStatusCode.Unauthorized)
{
Log.Add(Log.LogSeverity.Information, "Nebula.ApiCall()", "Nebula: User login token is expired.");
apiUserToken = null;
return await ApiCall(resourceUrl, data, needsLogIn, timeoutSeconds, method);
}
/* Upload/Update/delete Mod Timeout Hack */
if(response.StatusCode.ToString() == "GatewayTimeout" && (resourceUrl == "mod/release" || resourceUrl == "mod/release/update" || resourceUrl == "mod/release/delete"))
{
Expand Down Expand Up @@ -773,6 +780,16 @@ private enum ApiMethod
return reply;
}
}
else
{
/* Nebula responds with a HTTP status code 401 for expired tokens, so lets try this again */
if (needsLogIn && apiUserToken != null && response.StatusCode == System.Net.HttpStatusCode.Unauthorized)
{
Log.Add(Log.LogSeverity.Information, "Nebula.ApiCall()", "Nebula: User login token is expired.");
apiUserToken = null;
return await ApiCall(resourceUrl, data, needsLogIn, timeoutSeconds, method);
}
}
Log.Add(Log.LogSeverity.Error, "Nebula.ApiCall(" + resourceUrl + ")", "An error has ocurred during nebula api GET call: " + response.StatusCode + "(" + (int)response.StatusCode + ").");
}
break;
Expand Down