Libraries refactor and add some sinks #4
|
@ -83,9 +83,9 @@ class Revolut(object):
|
||||||
settings.Revolut.RefreshToken = parsed["refresh_token"]
|
settings.Revolut.RefreshToken = parsed["refresh_token"]
|
||||||
settings.Revolut.SetupToken = "0"
|
settings.Revolut.SetupToken = "0"
|
||||||
settings.write()
|
settings.write()
|
||||||
self.log.info("Refreshed refresh token: {refresh_token}", refresh_token=settings.Revolut.RefreshToken)
|
self.log.info("Refreshed refresh token")
|
||||||
self.token = parsed["access_token"]
|
self.token = parsed["access_token"]
|
||||||
self.log.info("Refreshed access token: {access_token}", access_token=self.token)
|
self.log.info("Refreshed access token")
|
||||||
except KeyError:
|
except KeyError:
|
||||||
self.log.error(f"Token authorization didn't contain refresh or access token: {parsed}", parsed=parsed)
|
self.log.error(f"Token authorization didn't contain refresh or access token: {parsed}", parsed=parsed)
|
||||||
return False
|
return False
|
||||||
|
@ -119,7 +119,7 @@ class Revolut(object):
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
if "access_token" in parsed.keys():
|
if "access_token" in parsed.keys():
|
||||||
self.token = parsed["access_token"]
|
self.token = parsed["access_token"]
|
||||||
self.log.info("Refreshed access token: {access_token}", access_token=self.token)
|
self.log.info("Refreshed access token")
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
self.log.error(f"Token refresh didn't contain access token: {parsed}", parsed=parsed)
|
self.log.error(f"Token refresh didn't contain access token: {parsed}", parsed=parsed)
|
||||||
|
|
Loading…
Reference in New Issue