Created
August 6, 2019 12:49
-
-
Save nest-don/8e4a3a33d547a2f9b10fd55cc7ae10d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (result.HttpStatus == System.Net.HttpStatusCode.Unauthorized) | |
{ | |
/* | |
* The token has expired. Renew is auto-renew option | |
* has been requested. | |
*/ | |
if (Permit != null && AutoTokenRenew) | |
{ | |
if (ex.Call.Response.Headers.Contains("Token-Expired")) | |
{ | |
Permit.UseRefreshToken(); | |
ResultSingle<Permit<UserT>> renewResult = await GetAsync(Permit, | |
CreateRequest(Permit, true, data)); | |
if (renewResult.Code < 0) | |
return result; | |
UpdatePermit(renewResult); | |
} | |
} | |
else | |
{ | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment