getAccessTokenFromCode(redirectUri, code) {
    const clientId = this.getClientId();
    const clientSecret = this.getClientSecret();

    if (!clientId) {
      throw new Error('A client id is required. You can set the client id using .setClientId().');
    }
    let path = OAuth2TokenUrl(this.domain, this.domainDelimiter);
    path += '?grant_type=authorization_code';
    path += `&code=${code}`;
    path += `&client_id=${clientId}`;

    if (clientSecret) {
      path += `&client_secret=${clientSecret}`;
    } else {
      if (!this.codeVerifier) {
        throw new Error('You must use PKCE when generating the authorization URL to not include a client secret');
      }
      path += `&code_verifier=${this.codeVerifier}`;
    }
    if (redirectUri) {
      path += `&redirect_uri=${redirectUri}`;
    }

    const fetchOptions = {
      method: 'POST',
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
      },
    };
    return this.fetch(path, fetchOptions)
      .then((res) => parseResponse(res));
  }
Get an OAuth2 access token from an OAuth2 Code.
@arg {String} redirectUri - A URL to redirect the user to after
authenticating. This must be added to your app through the admin interface.
@arg {String} code - An OAuth2 code.
@returns {Object} An object containing the token and related info (if applicable)