Mistři v programování na #hovnokod

JavaScript #4600

ked zakaznik si pise kod.

import apiClient from '../../common/services/apiClient';
import { hasInternalCookie } from '../../config';

const { initWidget } = window;

export default {
  getPartnerTokenAndInitWidget: (cookies) => {
    if (hasInternalCookie(cookies)) {
      // convert id token to partner token and initialize Growth Engine widget
      return apiClient
        .put('/user/id-token')
        .then(res => {
          initWidget({
            community: 'myCommunity',
            authenticationToken: res.data.idToken,
          });
        });
    }
  },
};

Anonymous,