File tree Expand file tree Collapse file tree
packages/amplify-gen2-migration-e2e-system/src/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -201,17 +201,22 @@ export class CategoryInitializer {
201201 IAM : 'IAM' ,
202202 API_KEY : 'API key' ,
203203 COGNITO_USER_POOLS : 'Amazon Cognito User Pool' ,
204+ AMAZON_COGNITO_USER_POOLS : 'Amazon Cognito User Pool' ,
204205 } ;
205206
206207 const authTypesConfig : Record < string , Record < string , unknown > > = { } ;
207208 for ( const mode of apiConfig . authModes ?? [ ] ) {
208209 const mapped = authModeMap [ mode ] ;
209- if ( mapped ) authTypesConfig [ mapped ] = { } ;
210+ if ( ! mapped ) {
211+ throw new Error (
212+ `Unsupported auth mode '${ mode } ' in migration-config.json. Supported modes: ${ Object . keys ( authModeMap ) . join ( ', ' ) } ` ,
213+ ) ;
214+ }
215+ authTypesConfig [ mapped ] = { } ;
210216 }
211217
212- // Fallback: ensure at least API key is present
213218 if ( Object . keys ( authTypesConfig ) . length === 0 ) {
214- authTypesConfig [ 'API key' ] = { } ;
219+ throw new Error ( 'migration-config.json must specify at least one authMode for the GraphQL API' ) ;
215220 }
216221
217222 // Pass requireAuthSetup = false because the auth category is already initialized
You can’t perform that action at this time.
0 commit comments