Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_getConfig() {
let accessToken = config.contentful ? config.contentful.accessToken : config.contentfulAccessToken;
let api = 'cdn';
let space = config.contentful ? config.contentful.space : config.contentfulSpace;
let previewAccessToken = config.contentful ? config.contentful.previewAccessToken : config.contentfulPreviewAccessToken;
if (config.contentful.usePreviewApi || config.contentfulUsePreviewApi) {
if (!previewAccessToken) {
console.warn('You have specified to use the Contentful Preview API; However, no `previewAccessToken` has been specified in config/environment.js'); /* eslint-disable-line no-console */
} else {
accessToken = previewAccessToken;
api = 'preview';
}
}
if (config.contentfulAccessToken || config.contentfulSpace) {
/* eslint-disable-next-line no-console */
console.warn(`DEPRECATION: Use of 'contentfulAccessToken' and 'contentfulSpace' will be removed in ember-data-contentful@1.0.0. please migrate to the contentful object syntax:
contentful: {
accessToken: '${accessToken}',
space: '${space}'
_getConfig() {
let accessToken = config.contentful ? config.contentful.accessToken : config.contentfulAccessToken;
let api = 'cdn';
let space = config.contentful ? config.contentful.space : config.contentfulSpace;
let previewAccessToken = config.contentful ? config.contentful.previewAccessToken : config.contentfulPreviewAccessToken;
if (config.contentful.usePreviewApi || config.contentfulUsePreviewApi) {
if (!previewAccessToken) {
console.warn('You have specified to use the Contentful Preview API; However, no `previewAccessToken` has been specified in config/environment.js'); /* eslint-disable-line no-console */
} else {
accessToken = previewAccessToken;
api = 'preview';
}
}
if (config.contentfulAccessToken || config.contentfulSpace) {
/* eslint-disable-next-line no-console */
console.warn(`DEPRECATION: Use of 'contentfulAccessToken' and 'contentfulSpace' will be removed in ember-data-contentful@1.0.0. please migrate to the contentful object syntax:
contentful: {
accessToken: '${accessToken}',
space: '${space}'
}`);
}
return {
accessToken,
api,
space
};
}
});