From 09e376dc7a349234697e51c121c9c47692ee744f Mon Sep 17 00:00:00 2001 From: Guide Fari Date: Thu, 23 Nov 2023 02:24:05 +0200 Subject: [PATCH] docs: secure-our-serverless-apis.md (#743) * Update secure-our-serverless-apis.md * docs: formatting * docs: specify amplify version - v6 api is different. tutorial was breaking as it's built on v5 of amplify * Update secure-our-serverless-apis.md --------- Co-authored-by: Jay --- _chapters/configure-aws-amplify.md | 2 +- _chapters/secure-our-serverless-apis.md | 20 ++++---------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/_chapters/configure-aws-amplify.md b/_chapters/configure-aws-amplify.md index d29ef8dc6..5630180ea 100644 --- a/_chapters/configure-aws-amplify.md +++ b/_chapters/configure-aws-amplify.md @@ -17,7 +17,7 @@ To do this we'll be using a library called [AWS Amplify](https://github.com/aws/ {%change%} Run the following command **in the `packages/frontend/` directory**. ```bash -$ pnpm add --save aws-amplify +$ pnpm add --save aws-amplify@^5 ``` This installs the NPM package and adds the dependency to the `package.json` of your React app.. diff --git a/_chapters/secure-our-serverless-apis.md b/_chapters/secure-our-serverless-apis.md index ebf7b5ed0..969a936d9 100644 --- a/_chapters/secure-our-serverless-apis.md +++ b/_chapters/secure-our-serverless-apis.md @@ -51,23 +51,11 @@ Let's change that. userId: event.requestContext.authorizer?.iam.cognitoIdentity.identityId, ``` -{%change%} Do the same in the `packages/functions/src/get.ts`. +{%change%} Do the same in these files: -```typescript -userId: event.requestContext.authorizer?.iam.cognitoIdentity.identityId, -``` - -{%change%} And in the `packages/functions/src/update.ts`. - -```typescript -userId: event.requestContext.authorizer?.iam.cognitoIdentity.identityId, -``` - -{%change%} In `packages/functions/src/delete.ts` as well. - -```typescript -userId: event.requestContext.authorizer?.iam.cognitoIdentity.identityId, -``` +- `packages/functions/src/get.ts` +- `packages/functions/src/update.ts` +- `packages/functions/src/delete.ts` {%change%} In `packages/functions/src/list.ts` find this line instead.