Skip to content

Commit da66064

Browse files
authored
Merge pull request aws-amplify#1357 from aws-amplify/feat-usernameAlias-doc
readme usernameAlias auth
2 parents 359bb32 + c90f278 commit da66064

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed

docs/ui/auth/fragments/angular/authenticator.md

+17
Original file line numberDiff line numberDiff line change
@@ -242,3 +242,20 @@ Amplify UI Components use `slots` based off of the [Web Components slot element]
242242
```
243243

244244
<ui-component-props tag="amplify-greetings"></ui-component-props>
245+
246+
## Use Cases
247+
248+
### Authenticate with email or phone number
249+
250+
The `amplify-authenticator` component has the ability to sign in / sign up with `email` or `phone_number` instead of default `username`.
251+
252+
To achieve this, you first need to setup the userpool to allow email or phone number as the username [using the cli workflow](https://aws-amplify.github.io/docs/cli-toolchain/quickstart#configuring-auth-without-social-providers) or through the [Cognito Console](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html#user-pool-settings-aliases-settings-option-2). To reflect this in the `amplify-authenticator` component, you can use the `usernameAlias` property. It can take one of the three values - `email`, `phone_number` or `username`. Default is set to `username`.
253+
254+
```html
255+
<amplify-authenticator username-alias="email">
256+
<div>
257+
My App
258+
<amplify-sign-out></amplify-sign-out>
259+
</div>
260+
</amplify-authenticator>
261+
```

docs/ui/auth/fragments/ionic/authenticator.md

+17
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,20 @@ Amplify UI Components use `slots` based off of the [Web Components slot element]
231231
```
232232

233233
<ui-component-props tag="amplify-greetings"></ui-component-props>
234+
235+
## Use Cases
236+
237+
### Authenticate with email or phone number
238+
239+
The `amplify-authenticator` component has the ability to sign in / sign up with `email` or `phone_number` instead of default `username`.
240+
241+
To achieve this, you first need to setup the userpool to allow email or phone number as the username [using the cli workflow](https://aws-amplify.github.io/docs/cli-toolchain/quickstart#configuring-auth-without-social-providers) or through the [Cognito Console](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html#user-pool-settings-aliases-settings-option-2). To reflect this in the `amplify-authenticator` component, you can use the `usernameAlias` property. It can take one of the three values - `email`, `phone_number` or `username`. Default is set to `username`.
242+
243+
```html
244+
<amplify-authenticator username-alias="email">
245+
<div>
246+
My App
247+
<amplify-sign-out></amplify-sign-out>
248+
</div>
249+
</amplify-authenticator>
250+
```

docs/ui/auth/fragments/react/authenticator.md

+19
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,22 @@ const App = () => (
277277
```
278278

279279
<ui-component-props tag="amplify-greetings"></ui-component-props>
280+
281+
## Use Cases
282+
283+
### Authenticate with email or phone number
284+
285+
The `AmplifyAuthenticator` component has the ability to sign in / sign up with `email` or `phone_number` instead of default `username`.
286+
287+
To achieve this, you first need to setup the userpool to allow email or phone number as the username [using the cli workflow](https://aws-amplify.github.io/docs/cli-toolchain/quickstart#configuring-auth-without-social-providers) or through the [Cognito Console](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html#user-pool-settings-aliases-settings-option-2). To reflect this in the `AmplifyAuthenticator` component, you can use the `usernameAlias` property. It can take one of the three values - `email`, `phone_number` or `username`. Default is set to `username`.
288+
289+
```jsx
290+
const App = () => (
291+
<AmplifyAuthenticator usernameAlias="email">
292+
<div>
293+
My App
294+
<AmplifySignOut />
295+
</div>
296+
</AmplifyAuthenticator>
297+
);
298+
```

docs/ui/auth/fragments/vue/authenticator.md

+18
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,21 @@ Amplify UI Components use `slots` based off of the [Web Components slot element]
238238
```
239239

240240
<ui-component-props tag="amplify-greetings"></ui-component-props>
241+
242+
243+
## Use Cases
244+
245+
### Authenticate with email or phone number
246+
247+
The `amplify-authenticator` component has the ability to sign in / sign up with `email` or `phone_number` instead of default `username`.
248+
249+
To achieve this, you first need to setup the userpool to allow email or phone number as the username [using the cli workflow](https://aws-amplify.github.io/docs/cli-toolchain/quickstart#configuring-auth-without-social-providers) or through the [Cognito Console](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html#user-pool-settings-aliases-settings-option-2). To reflect this in the `amplify-authenticator` component, you can use the `usernameAlias` property. It can take one of the three values - `email`, `phone_number` or `username`. Default is set to `username`.
250+
251+
```html
252+
<amplify-authenticator username-alias="email">
253+
<div>
254+
My App
255+
<amplify-sign-out></amplify-sign-out>
256+
</div>
257+
</amplify-authenticator>
258+
```

0 commit comments

Comments
 (0)