Private
Public Access
1
0

tested refresh TP token

This commit is contained in:
Sander Roosendaal
2017-04-22 19:40:32 +02:00
parent 646894cad2
commit b71937d0db
2 changed files with 10 additions and 3 deletions

View File

@@ -1087,7 +1087,13 @@ def tp_open(user):
raise TPNoTokenError("User has no token")
else:
if (timezone.now()>r.tptokenexpirydate):
thetoken = tpstuff.rower_tp_token_refresh(user)
res = tpstuff.do_refresh_token(r.tprefreshtoken)
r.tptoken = res[0]
r.tprefreshtoken = res[2]
expirydatetime = timezone.now()+datetime.timedelta(seconds=res[1])
r.tptokenexpirydate = expirydatetime
r.save()
thetoken = r.tptoken
else:
thetoken = r.tptoken