Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function addWalkthrough(context, defaultValuesFilename, serviceMetadata, options) {
while (!checkIfAuthExists(context)) {
if (
await context.amplify.confirmPrompt.run(
'You need to add auth (Amazon Cognito) to your project in order to add storage for user files. Do you want to add auth now?'
)
) {
try {
const { add } = require('amplify-category-auth');
await add(context);
} catch (e) {
context.print.error('The Auth plugin is not installed in the CLI. You need to install it to use this feature');
break;
}
break;
} else {
process.exit(0);
}
}
const resourceName = resourceAlreadyExists(context);
if (resourceName) {
context.print.warning('Amazon S3 storage was already added to your project.');
process.exit(0);
} else {
return await configure(context, defaultValuesFilename, serviceMetadata, undefined, options);
async function addWalkthrough(context) {
while (!checkIfAuthExists(context)) {
if (
await context.amplify.confirmPrompt.run(
'You need to add auth (Amazon Cognito) to your project in order to add storage for user files. Do you want to add auth now?'
)
) {
try {
const { add } = require('amplify-category-auth');
await add(context);
} catch (e) {
context.print.error('The Auth plugin is not installed in the CLI. You need to install it to use this feature');
break;
}
break;
} else {
process.exit(0);
}
}
return await configure(context);
}
async function addWalkthrough(context) {
while (!checkIfAuthExists(context)) {
if (
await context.amplify.confirmPrompt.run(
'You need to add auth (Amazon Cognito) to your project in order to add storage for user files. Do you want to add auth now?'
)
) {
try {
const { add } = require('amplify-category-auth');
await add(context);
} catch (e) {
context.print.error('The Auth plugin is not installed in the CLI. You need to install it to use this feature');
break;
}
break;
} else {
process.exit(0);
}
}
return await configure(context);
}
async function addWalkthrough(context) {
while (!checkIfAuthExists(context)) {
if (
await context.amplify.confirmPrompt.run(
'You need to add auth (Amazon Cognito) to your project in order to add storage for user files. Do you want to add auth now?'
)
) {
try {
const { add } = require('amplify-category-auth');
await add(context);
} catch (e) {
context.print.error('The Auth plugin is not installed in the CLI. You need to install it to use this feature');
break;
}
break;
} else {
process.exit(0);
}
}
return await configure(context);
}
async function addWalkthrough(context) {
while (!checkIfAuthExists(context)) {
if (
await context.amplify.confirmPrompt.run(
'You need to add auth (Amazon Cognito) to your project in order to add storage for user files. Do you want to add auth now?'
)
) {
try {
const { add } = require('amplify-category-auth');
await add(context);
} catch (e) {
context.print.error('The Auth plugin is not installed in the CLI. You need to install it to use this feature');
break;
}
break;
} else {
process.exit(0);
}
}
return await configure(context);
}
async function askUserPoolQuestions(context) {
let authResourceName = checkIfAuthExists(context);
if (!authResourceName) {
try {
const { add } = require('amplify-category-auth');
authResourceName = await add(context);
} catch (e) {
context.print.error('Auth plugin not installed in the CLI. You need to install it to use this feature.');
}
} else {
context.print.info('Use a Cognito user pool configured as a part of this project.');
}
return {
authenticationType: 'AMAZON_COGNITO_USER_POOLS',
userPoolConfig: {
userPoolId: `auth${authResourceName}`,
},
};
}