wirejs-deploy-amplify-basic 0.0.32 → 0.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,11 +7,23 @@ import { Bucket, BlockPublicAccess } from 'aws-cdk-lib/aws-s3';
7
7
  import { api } from './functions/api/resource';
8
8
  import { auth } from './auth/resource';
9
9
 
10
+
11
+ /**
12
+ * Amplify resources
13
+ */
10
14
  const backend = defineBackend({
11
15
  auth,
12
16
  api,
13
17
  });
14
18
 
19
+ const userPoolClient = backend.auth.resources.cfnResources.cfnUserPoolClient;
20
+ userPoolClient.explicitAuthFlows = userPoolClient.explicitAuthFlows || [];
21
+ userPoolClient.explicitAuthFlows.push('USER_PASSWORD_AUTH');
22
+
23
+
24
+ /**
25
+ * CDK resources
26
+ */
15
27
  const bucket = new Bucket(backend.stack, 'data', {
16
28
  blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
17
29
  versioned: true,
@@ -19,18 +31,24 @@ const bucket = new Bucket(backend.stack, 'data', {
19
31
  });
20
32
  bucket.grantReadWrite(backend.api.resources.lambda);
21
33
 
34
+
35
+ /**
36
+ * Lambda environment vars
37
+ */
22
38
  backend.api.addEnvironment(
23
39
  'BUCKET', bucket.bucketName,
24
40
  );
25
-
26
41
  backend.api.addEnvironment(
27
42
  'COGNITO_CLIENT_ID', backend.auth.resources.userPoolClient.userPoolClientId
28
43
  );
29
44
 
45
+
46
+ /**
47
+ * Client configuration
48
+ */
30
49
  const apiUrl = backend.api.resources.lambda.addFunctionUrl({
31
50
  authType: FunctionUrlAuthType.NONE
32
51
  });
33
-
34
52
  backend.addOutput({
35
53
  custom: {
36
54
  api: apiUrl.url
@@ -140,7 +140,7 @@ export class AuthenticationService extends AuthenticationServiceBase {
140
140
  return {
141
141
  state: 'unauthenticated',
142
142
  user: undefined,
143
- actions: machineActions('completesignup', 'cancel')
143
+ actions: machineActions('completesignup', 'resendsignupcode', 'cancel')
144
144
  };
145
145
  }
146
146
  else if (state?.substate === 'pending-continueforgotpassword') {
@@ -161,7 +161,7 @@ export class AuthenticationService extends AuthenticationServiceBase {
161
161
  return {
162
162
  state: 'unauthenticated',
163
163
  user: undefined,
164
- actions: machineActions('signin', 'startsignup', 'startforgotpassword', 'resendsignupcode')
164
+ actions: machineActions('signin', 'startsignup', 'startforgotpassword')
165
165
  };
166
166
  }
167
167
  }
@@ -281,7 +281,7 @@ export class AuthenticationService extends AuthenticationServiceBase {
281
281
  }
282
282
  const command = new ConfirmSignUpCommand({
283
283
  ClientId,
284
- Username: state.metadata,
284
+ Username: email,
285
285
  ConfirmationCode: form.inputs.code
286
286
  });
287
287
  await client.send(command);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-deploy-amplify-basic",
3
- "version": "0.0.32",
3
+ "version": "0.0.34",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",