code: func (a *Authenticator) authTokenInjector(req *http.Request) error {
  	switch tok, err := a.GetAccessToken(minAcceptedLifetime); {
  	case err == ErrLoginRequired && a.effectiveLoginMode() == OptionalLogin:
  		return nil // skip auth, no need for modifications
  	case err != nil:
  		return err
  	default:
  		tok.SetAuthHeader(req)
  		return nil
  	}
  }
docs: ////////////////////////////////////////////////////////////////////////////////
  // Transport implementation.
  // authTokenInjector injects an authentication token into request headers.
  //
  // Used as a callback for NewModifyingTransport.