From 639bd1fc86a015638574afa207b760c2a436512d Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Sat, 6 Mar 2021 13:34:33 +0100 Subject: [PATCH] Fix token refresh change The login token now needs to be fetched every 2 minutes instead of the previous 10 minutes. --- charger/mcc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charger/mcc.go b/charger/mcc.go index a8b223966..dfaeb765c 100644 --- a/charger/mcc.go +++ b/charger/mcc.go @@ -108,8 +108,8 @@ func (mcc *MobileConnect) fetchToken(request *http.Request) error { } mcc.token = tr.Token - // According to the Web Interface, the token is valid for 10 minutes - mcc.tokenValid = time.Now().Add(10 * time.Minute) + // According to the Web Interface, the token is valid for 2 minutes + mcc.tokenValid = time.Now().Add(2 * time.Minute) // the web interface updates the token every 2 minutes, so lets do the same here mcc.tokenRefresh = time.Now().Add(2 * time.Minute)