Added new notification nuget. Added auto regenerate JWT token on error.
This commit is contained in:
@@ -34,8 +34,18 @@ namespace BodyshopPartner.Utils
|
||||
else
|
||||
{
|
||||
string exceptionString = "";
|
||||
bool jwtExpired = false;
|
||||
logger.Error("Error executing query.");
|
||||
Array.ForEach(graphQLResponse.Errors, x => { logger.Error(x.Message); exceptionString = exceptionString + x + ";"; });
|
||||
Array.ForEach(graphQLResponse.Errors, x =>
|
||||
{
|
||||
logger.Error(x.Message);
|
||||
if (x.Message.Contains("JWTExpired"))
|
||||
{
|
||||
jwtExpired = true;
|
||||
};
|
||||
exceptionString = exceptionString + x + ";";
|
||||
});
|
||||
if (jwtExpired) await Utils.Auth.Refresh(); ;
|
||||
logger.Error("---------------------");
|
||||
throw new Exception(exceptionString);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user