Skip to content

Commit d6a5fe2

Browse files
committed
correct heading order
1 parent 5f581df commit d6a5fe2

File tree

2 files changed

+27
-26
lines changed
  • src/pages/[platform]/build-a-backend/auth

2 files changed

+27
-26
lines changed

src/pages/[platform]/build-a-backend/auth/concepts/user-attributes/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Custom attributes can also be configured with specific data types. The following
113113

114114
Shown in the snippet above, `String` and `Number` can be assigned minimum and maximum constraints. This is useful to defer simple validations to the underlying service, although does not extend to complex validations such as matching against a regular expression.
115115

116-
### Next steps
116+
## Next steps
117117

118118
- [Learn how attributes are surfaced to tokens](/[platform]/build-a-backend/auth/concepts/tokens-and-credentials/)
119119
- [Learn how to manage your user attributes](/[platform]/build-a-backend/auth/connect-your-frontend/manage-user-attributes)

src/pages/[platform]/build-a-backend/auth/connect-your-frontend/manage-user-attributes/index.mdx

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function getStaticProps() {
3131
User attributes such as email address, phone number help you identify individual users. Defining the user attributes you include for your user profiles makes user data easy to manage at scale. This information will help you personalize user journeys, tailor content, provide intuitive account control, and more. You can capture information upfront during sign-up or enable customers to update their profile after sign-up. In this section we take a closer look at working with user attributes, how to set them up and manage them.
3232

3333
<InlineFilter filters={['javascript', 'angular', 'react', 'vue', 'react-native', 'nextjs']}>
34-
### Pass user attributes during sign-up
34+
## Pass user attributes during sign-up
3535

3636
You can create user attributes during sign-up or when the user is authenticated. To do this as part of sign-up you can pass them in the `userAttributes` object of the `signUp` API:
3737

@@ -55,28 +55,28 @@ await signUp({
5555
</InlineFilter>
5656

5757
<InlineFilter filters={['javascript', 'angular', 'react', 'vue', 'react-native', 'nextjs', 'flutter', 'swift']}>
58-
### Configure custom user attributes during sign-up
58+
59+
## Configure custom user attributes during sign-up
5960

6061
Custom attributes can be passed in with the `userAttributes` option of the `signUp` API:
6162

6263
<InlineFilter filters={['javascript', 'angular', 'react', 'vue', 'react-native', 'nextjs']}>
63-
```javascript
64+
65+
```ts
6466
import { signUp } from "aws-amplify/auth";
6567

6668
await signUp({
67-
username: 'jdoe',
68-
password: 'mysecurerandompassword#123',
69+
username: 'john.doe@example.com',
70+
password: 'hunter2',
6971
options: {
7072
userAttributes: {
71-
'custom:attribute_name_1': 'attribute_value_1',
72-
'custom:attribute_name_2': 'attribute_value_2',
73-
'custom:attribute_name_3': 'attribute_value_3'
73+
'custom:display_name': 'john_doe123',
7474
}
7575
}
7676
});
7777
```
78-
</InlineFilter>
7978

79+
</InlineFilter>
8080
<InlineFilter filters={['flutter']}>
8181

8282
```dart
@@ -100,8 +100,8 @@ Future<void> _signUp({
100100
);
101101
}
102102
```
103-
</InlineFilter>
104103

104+
</InlineFilter>
105105
<InlineFilter filters={['swift']}>
106106

107107
```swift
@@ -127,25 +127,26 @@ func signUp(username: String, password: String, email: String) async {
127127
}
128128
}
129129
```
130+
130131
</InlineFilter>
131132
</InlineFilter>
132133

133-
### Retrieve user attributes
134+
## Retrieve user attributes
134135

135136
You can retrieve user attributes for your users to read in their profile using the `fetchUserAttributes` API. This helps you personalize their frontend experience as well as control what they will see.
136137

137138
<InlineFilter filters={['javascript', 'angular', 'react', 'vue', 'react-native', 'nextjs']}>
138-
```javascript
139+
140+
```ts
139141
import { fetchUserAttributes } from 'aws-amplify/auth';
140142

141143
await fetchUserAttributes();
142144
```
143-
</InlineFilter>
144145

146+
</InlineFilter>
145147
<InlineFilter filters={['swift']}>
146148

147149
<BlockSwitcher>
148-
149150
<Block name="Async/Await">
150151

151152
```swift
@@ -162,7 +163,6 @@ func fetchAttributes() async {
162163
```
163164

164165
</Block>
165-
166166
<Block name="Combine">
167167

168168
```swift
@@ -181,11 +181,11 @@ func fetchAttributes() -> AnyCancellable {
181181
```
182182

183183
</Block>
184-
185184
</BlockSwitcher>
186-
</InlineFilter>
187185

186+
</InlineFilter>
188187
<InlineFilter filters={['android']}>
188+
189189
<BlockSwitcher>
190190
<Block name="Java">
191191

@@ -233,9 +233,10 @@ RxAmplify.Auth.fetchUserAttributes()
233233

234234
</Block>
235235
</BlockSwitcher>
236-
</InlineFilter>
237236

237+
</InlineFilter>
238238
<InlineFilter filters={['flutter']}>
239+
239240
```dart
240241
Future<void> fetchCurrentUserAttributes() async {
241242
try {
@@ -248,10 +249,10 @@ Future<void> fetchCurrentUserAttributes() async {
248249
}
249250
}
250251
```
251-
</InlineFilter>
252252

253+
</InlineFilter>
253254

254-
### Update user attribute
255+
## Update user attribute
255256

256257
You can use the `updateUserAttribute` API to create or update existing user attributes.
257258

@@ -538,7 +539,7 @@ Future<void> updateUserAttributes() async {
538539
</InlineFilter>
539540
540541
<InlineFilter filters={['javascript', 'angular', 'react', 'vue', 'react-native', 'nextjs', 'android']}>
541-
### Update user attributes
542+
## Update user attributes
542543
543544
You can use the `updateUserAttributes` API to create or update multiple existing user attributes.
544545
@@ -608,7 +609,7 @@ RxAmplify.Auth.updateUserAttributes(attributes)
608609
</InlineFilter>
609610
</InlineFilter>
610611
611-
### Verify user attribute
612+
## Verify user attribute
612613
613614
<InlineFilter filters={['javascript', 'angular', 'react', 'vue', 'react-native', 'nextjs', 'flutter', 'android']}>
614615
Some attributes require confirmation for the attribute update to complete. If the attribute needs to be confirmed, part of the result of the `updateUserAttribute` or `updateUserAttributes` APIs will be `CONFIRM_ATTRIBUTE_WITH_CODE`. A confirmation code will be sent to the delivery medium mentioned in the delivery details. When the user gets the confirmation code, you can present a UI to the user to enter the code and invoke the `confirmUserAttribute` API with their input:
@@ -744,7 +745,7 @@ Future<void> verifyAttributeUpdate() async {
744745
</InlineFilter>
745746
746747
747-
### Send user attribute verification code
748+
## Send user attribute verification code
748749
749750
If an attribute needs to be verified while the user is authenticated, invoke the `sendUserAttributeVerificationCode` API as shown below:
750751
@@ -877,7 +878,7 @@ Future<void> resendVerificationCode() async {
877878
</InlineFilter>
878879
879880
<InlineFilter filters={['javascript', 'angular', 'react', 'vue', 'react-native', 'nextjs']}>
880-
### Delete user attributes
881+
## Delete user attributes
881882
882883
The `deleteUserAttributes` API allows to delete one or more user attributes.
883884
@@ -901,7 +902,7 @@ async function handleDeleteUserAttributes(
901902
```
902903
</InlineFilter>
903904
904-
#### Next Steps
905+
## Next Steps
905906
906907
- [Learn how to set up password change and recovery](/[platform]/build-a-backend/auth/manage-users/manage-passwords/)
907908
- [Learn how to set up custom attributes](/[platform]/build-a-backend/auth/concepts/user-attributes/#custom-attributes)

0 commit comments

Comments
 (0)