Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(gen2): replace authMode 'iam' with 'identityPool' #7370

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/pages/gen2/build-a-backend/data/connect-to-API/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ import { generateClient } from 'aws-amplify/data';
import type { Schema } from '../amplify/data/resource'; // Path to your backend resource definition

const client = generateClient<Schema>({
authMode: 'iam',
authMode: 'identityPool',
});
```

Expand Down Expand Up @@ -166,7 +166,7 @@ const { data: todos, errors } = await client.models.Todo.list({

```ts
const { data: todos, errors } = await client.models.Todo.list({
authMode: 'iam',
authMode: 'identityPool',
});
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Amplify.configure(
GraphQL: {
endpoint: env.<amplifyData>_GRAPHQL_ENDPOINT, // replace with your defineData name
region: env.AWS_REGION,
defaultAuthMode: 'iam',
defaultAuthMode: 'identityPool',
modelIntrospection: modelIntrospection as never
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const { data: newPostResult , errors } = await client.models.Post.create({
// Listing posts is available to unauthenticated users (verified by Amazon Cognito identity pool's unauthenticated role)
const { data: listPostsResult , errors } = await client.models.Post.list({
query: queries.listPosts,
authMode: 'iam',
authMode: 'identityPool',
});
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const { errors, data: newTodo } = await client.models.Todo.create(
},
// highlight-start
{
authMode: 'iam',
authMode: 'identityPool',
}
// highlight-end
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const schema = a.schema({
.model({
content: a.string(),
})
.authorization(allow => [allow.authenticated('iam')]),
.authorization(allow => [allow.authenticated('identityPool')]),
});
```

Expand All @@ -86,7 +86,7 @@ const { errors, data: newTodo } = await client.models.Todo.create(
},
// highlight-start
{
authMode: 'iam',
authMode: 'identityPool',
}
// highlight-end
);
Expand Down
Loading