fix API refreshing tokens

This commit is contained in:
Andre Medeiros 2021-07-12 16:12:34 -04:00
parent 2304015aac
commit e0c18b8f79

View file

@ -34,8 +34,10 @@ func (app *application) upsertAccountHandler(w http.ResponseWriter, r *http.Requ
// Reset expiration timer // Reset expiration timer
a.ExpiresAt = time.Now().Unix() + 3540 a.ExpiresAt = time.Now().Unix() + 3540
a.RefreshToken = tokens.RefreshToken
a.AccessToken = tokens.AccessToken
ac = app.client.NewAuthenticatedClient(tokens.RefreshToken, tokens.AccessToken) ac = app.client.NewAuthenticatedClient(a.RefreshToken, a.AccessToken)
me, err := ac.Me() me, err := ac.Me()
if err != nil { if err != nil {