MCPcopy Create free account
hub / github.com/basecamp/hey-cli / Refresh

Method Refresh

internal/auth/auth.go:216–231  ·  view source on GitHub ↗

Refresh forces a token refresh.

(ctx context.Context)

Source from the content-addressed store, hash-verified

214
215// Refresh forces a token refresh.
216func (m *Manager) Refresh(ctx context.Context) error {
217 m.mu.Lock()
218 defer m.mu.Unlock()
219
220 creds, err := m.store.Load(m.baseURL)
221 if err != nil {
222 return fmt.Errorf("not authenticated: %w", err)
223 }
224
225 // Cookie-based auth doesn't support refresh; treat as no-op.
226 if creds.RefreshToken == "" && creds.SessionCookie != "" {
227 return nil
228 }
229
230 return m.refreshLocked(ctx, creds)
231}
232
233func (m *Manager) refreshLocked(ctx context.Context, creds *Credentials) error {
234 if creds.RefreshToken == "" {

Callers 1

newAuthRefreshCommandFunction · 0.80

Calls 2

refreshLockedMethod · 0.95
LoadMethod · 0.80

Tested by

no test coverage detected