diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-02-24 13:38:47 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-02-24 13:38:47 +0200 |
| commit | 64b768178dc9e64293a52c1b6d2631709af9502a (patch) | |
| tree | 6b7782fdbbbab4f734a1cb499cca03728c4f8f69 /Software/Visual_Studio/Tango.Web/TangoWebClient.cs | |
| parent | 028ab0e5cc2699ceec3e04b1eeab5f56b9b38083 (diff) | |
| download | Tango-64b768178dc9e64293a52c1b6d2631709af9502a.tar.gz Tango-64b768178dc9e64293a52c1b6d2631709af9502a.zip | |
Removed all refresh tokens use :/
Diffstat (limited to 'Software/Visual_Studio/Tango.Web/TangoWebClient.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Web/TangoWebClient.cs | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/Software/Visual_Studio/Tango.Web/TangoWebClient.cs b/Software/Visual_Studio/Tango.Web/TangoWebClient.cs index 08fc19099..1d2f9fc8e 100644 --- a/Software/Visual_Studio/Tango.Web/TangoWebClient.cs +++ b/Software/Visual_Studio/Tango.Web/TangoWebClient.cs @@ -70,29 +70,13 @@ namespace Tango.Web return response; } - private async Task Renew() - { - var response = await _client.PostJson<RenewTokenRequest, RenewTokenResponse>(GetActionAddress("Renew"), new RenewTokenRequest() - { - RefreshToken = WebToken.RefreshToken, - }); - - Token = response.AccessToken; - _client.AuthenticationToken = Token; - - WebToken = WebToken.FromToken(Token); - - IsAuthenticated = true; - } - protected virtual async Task<TResponse> Post<TRequest, TResponse>(String action, TRequest request) where TRequest : class, IWebRequestMessage where TResponse : class, IWebResponseMessage { if (IsAuthenticated) { if (DateTime.UtcNow >= WebToken.Expiration) { - await Renew(); - //await Login(_lastLoginRequest); + await Login(_lastLoginRequest); } } @@ -105,8 +89,7 @@ namespace Tango.Web { try { - //await Login(_lastLoginRequest); - await Renew(); + await Login(_lastLoginRequest); var response = await _client.PostJson<TRequest, TResponse>(GetActionAddress(action), request); return response; } |
