MCPcopy Create free account
hub / github.com/dropbox/dbxcli / shouldRefresh

Method shouldRefresh

cmd/auth.go:168–179  ·  view source on GitHub ↗
(now time.Time)

Source from the content-addressed store, hash-verified

166}
167
168func (c *storedCredential) shouldRefresh(now time.Time) bool {
169 if c.RefreshToken == "" {
170 return false
171 }
172 if c.AccessToken == "" {
173 return true
174 }
175 if c.Expiry == nil {
176 return false
177 }
178 return !c.Expiry.After(now.Add(tokenRefreshWindow))
179}
180
181func authFilePath() (string, error) {
182 if filePath := os.Getenv(envAuthFile); filePath != "" {

Callers 1

getAccessCredentialFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected