async function getStripeConnectOAuthUrl(setSessionProp, mode = 'live') {
    checkCanConnect();
    const randomState = randomBytes(16).toString('hex');
    const state = Buffer.from(JSON.stringify({
        mode,
        randomState
    })).toString('base64');

    await setSessionProp(STATE_PROP, state);

    const clientID = mode === 'live' ? liveClientID : testClientID;

    const authUrl = new URL('https://connect.stripe.com/oauth/authorize');
    authUrl.searchParams.set('response_type', 'code');
    authUrl.searchParams.set('scope', 'read_write');
    authUrl.searchParams.set('client_id', clientID);
    authUrl.searchParams.set('redirect_uri', redirectURI);
    authUrl.searchParams.set('state', state);

    return authUrl;
}
@function getStripeConnectOAuthUrl
@desc Returns a url for the auth endpoint for Stripe Connect, generates state and stores it on the session.

@param {(prop: string, val: any) => Promise<void>} setSessionProp - A function to set data on the current session
@param {'live' | 'test'} mode - Which stripe mode to set up

@returns {Promise<URL>}