File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/amplify-category-auth/src/events Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,15 @@ import { AuthInputState } from '../provider-utils/awscloudformation/auth-inputs-
3
3
import { getAuthResourceName } from '../utils/getAuthResourceName' ;
4
4
5
5
export const prePushHandler = async ( context : $TSContext ) : Promise < void > => {
6
- const inputState = new AuthInputState ( context , await getAuthResourceName ( context ) ) ;
6
+ let authResourceName : string ;
7
+ try {
8
+ authResourceName = await getAuthResourceName ( context ) ;
9
+ } catch {
10
+ // if the project doesn't have auth, early return
11
+ return ;
12
+ }
13
+
14
+ const inputState = new AuthInputState ( context , authResourceName ) ;
7
15
if ( ! inputState . cliInputFileExists ( ) ) {
8
16
throw new AmplifyError ( 'InvalidMigrationError' , {
9
17
message : 'Auth configuration needs to be migrated before pushing.' ,
You can’t perform that action at this time.
0 commit comments