Skip to content

Commit

Permalink
Replace usages of username with email
Browse files Browse the repository at this point in the history
  • Loading branch information
vincetran committed Nov 29, 2024
1 parent d77e718 commit 6f26a46
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ The `nextStep` property is of enum type `AuthSignInStep`. Depending on its value
```java
try {
Amplify.Auth.signIn(
"username",
"[email protected]",
"password",
result ->
{
Expand Down Expand Up @@ -1184,7 +1184,7 @@ try {
```kotlin
try {
Amplify.Auth.signIn(
"username",
"[email protected]",
"password",
{ result ->
val nextStep = result.nextStep
Expand Down Expand Up @@ -1291,7 +1291,7 @@ try {
```kotlin
try {
val result = Amplify.Auth.signIn(
"username",
"[email protected]",
"password"
)
val nextStep = result.nextStep
Expand Down Expand Up @@ -1391,7 +1391,7 @@ try {
<Block name="RxJava">

```java
RxAmplify.Auth.signIn("username", "password").subscribe(
RxAmplify.Auth.signIn("[email protected]", "password").subscribe(
result ->
{
AuthNextSignInStep nextStep = result.getNextStep();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1860,7 +1860,7 @@ AWSCognitoAuthSignInOptions options =
.callingActivity(callingActivity)
.build();
Amplify.Auth.signIn(
"username",
"[email protected]",
null,
options,
result -> {
Expand All @@ -1885,7 +1885,7 @@ val options = AWSCognitoAuthSignInOptions.builder()
.callingActivity(callingActivity)
.build()
Amplify.Auth.signIn(
"username",
"[email protected]",
null,
options,
{ result ->
Expand Down Expand Up @@ -1913,7 +1913,7 @@ try {
.callingActivity(callingActivity)
.build()
val result = Amplify.Auth.signIn(
username = "username",
username = "[email protected]",
password = null,
options = options
)
Expand All @@ -1939,7 +1939,7 @@ AWSCognitoAuthSignInOptions options =
.authFlowType(AuthFlowType.USER_AUTH)
.callingActivity(callingActivity)
.build();
RxAmplify.Auth.signIn("username", null, options)
RxAmplify.Auth.signIn("[email protected]", null, options)
.subscribe(
result -> {
if (result.getNextStep().getSignInStep() == AuthSignInStep.CONTINUE_SIGN_IN_WITH_FIRST_FACTOR_SELECTION) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ ArrayList<AuthUserAttribute> attributes = new ArrayList<>();
attributes.add(new AuthUserAttribute(AuthUserAttributeKey.phoneNumber(), "+15551234567"));

Amplify.Auth.signUp(
"username",
"[email protected]",
null,
AuthSignUpOptions.builder().userAttributes(attributes).build(),
result -> {
Expand All @@ -605,7 +605,7 @@ Amplify.Auth.signUp(

// Confirm sign up with the OTP received
Amplify.Auth.confirmSignUp(
"username",
"[email protected]",
"123456",
result -> {
if (result.isSignUpComplete()) {
Expand All @@ -631,7 +631,7 @@ val options =
.build()

Amplify.Auth.signUp(
"username",
"[email protected]",
null,
options,
{ result ->
Expand All @@ -649,7 +649,7 @@ Amplify.Auth.signUp(

// Confirm sign up with the OTP received
Amplify.Auth.confirmSignUp(
"username",
"[email protected]",
"123456",
{ result ->
if (result.nextStep.signUpStep == AuthSignUpStep.DONE) {
Expand All @@ -673,7 +673,7 @@ val options =
.builder()
.userAttributes(attributes)
.build()
var result = Amplify.Auth.signUp("username", null, options)
var result = Amplify.Auth.signUp("[email protected]", null, options)

if (result.isSignUpComplete) {
Log.i("AuthQuickstart", "Sign up is complete")
Expand All @@ -686,7 +686,7 @@ if (result.isSignUpComplete) {

// Confirm sign up with the OTP received
result = Amplify.Auth.confirmSignUp(
"username",
"[email protected]",
"123456"
)

Expand All @@ -704,7 +704,7 @@ ArrayList<AuthUserAttribute> attributes = new ArrayList<>();
attributes.add(new AuthUserAttribute(AuthUserAttributeKey.phoneNumber(), "+15551234567"));

RxAmplify.Auth.signUp(
"username",
"[email protected]",
null,
AuthSignUpOptions.builder().userAttributes(attributes).build()
)
Expand All @@ -724,7 +724,7 @@ RxAmplify.Auth.signUp(

// Confirm sign up with the OTP received
RxAmplify.Auth.confirmSignUp(
"username",
"[email protected]",
"123456"
)
.subscribe(
Expand Down Expand Up @@ -896,7 +896,7 @@ ArrayList<AuthUserAttribute> attributes = new ArrayList<>();
attributes.add(new AuthUserAttribute(AuthUserAttributeKey.email(), "[email protected]"));

Amplify.Auth.signUp(
"username",
"[email protected]",
null,
AuthSignUpOptions.builder().userAttributes(attributes).build(),
result -> {
Expand All @@ -914,7 +914,7 @@ Amplify.Auth.signUp(

// Confirm sign up with the OTP received
Amplify.Auth.confirmSignUp(
"username",
"[email protected]",
"123456",
result -> {
if (result.isSignUpComplete()) {
Expand All @@ -940,7 +940,7 @@ val options =
.build()

Amplify.Auth.signUp(
"username",
"[email protected]",
null,
options,
{ result ->
Expand All @@ -958,7 +958,7 @@ Amplify.Auth.signUp(

// Confirm sign up with the OTP received
Amplify.Auth.confirmSignUp(
"username",
"[email protected]",
"123456",
{ result ->
if (result.nextStep.signUpStep == AuthSignUpStep.DONE) {
Expand All @@ -982,7 +982,7 @@ val options =
.builder()
.userAttributes(attributes)
.build()
var result = Amplify.Auth.signUp("username", null, options)
var result = Amplify.Auth.signUp("[email protected]", null, options)

if (result.isSignUpComplete) {
Log.i("AuthQuickstart", "Sign up is complete")
Expand All @@ -995,7 +995,7 @@ if (result.isSignUpComplete) {

// Confirm sign up with the OTP received
result = Amplify.Auth.confirmSignUp(
"username",
"[email protected]",
"123456"
)

Expand All @@ -1013,7 +1013,7 @@ ArrayList<AuthUserAttribute> attributes = new ArrayList<>();
attributes.add(new AuthUserAttribute(AuthUserAttributeKey.email(), "[email protected]"));

RxAmplify.Auth.signUp(
"username",
"[email protected]",
null,
AuthSignUpOptions.builder().userAttributes(attributes).build()
)
Expand All @@ -1033,7 +1033,7 @@ RxAmplify.Auth.signUp(

// Confirm sign up with the OTP received
RxAmplify.Auth.confirmSignUp(
"username",
"[email protected]",
"123456"
)
.subscribe(
Expand Down Expand Up @@ -1237,7 +1237,7 @@ fun autoSignIn() {
suspend fun confirmSignUp(username: String, confirmationCode: String) {
// Confirm sign up with the OTP received then auto sign in
val result = Amplify.Auth.confirmSignUp(
"username",
"[email protected]",
"123456"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ try {
.preferredFirstFactor(AuthFactorType.PASSWORD_SRP) // or "PASSWORD"
.build()
val result = Amplify.Auth.signIn(
username = "username",
username = "[email protected]",
password = "password",
options = options
)
Expand All @@ -418,7 +418,7 @@ try {
.preferredFirstFactor(AuthFactorType.WEB_AUTHN) // or "EMAIL_OTP" or "SMS_OTP"
.build()
val result = Amplify.Auth.signIn(
username = "username",
username = "[email protected]",
password = null,
options = options
)
Expand Down Expand Up @@ -549,7 +549,7 @@ AuthSignInOptions options = AWSCognitoAuthSignInOptions.builder()
.authFlowType(AuthFlowType.USER_PASSWORD_AUTH)
.build();
Amplify.Auth.signIn(
"username",
"[email protected]",
"password",
options,
result -> Log.i("AuthQuickStart", "Sign in succeeded with result " + result),
Expand All @@ -565,7 +565,7 @@ val options = AWSCognitoAuthSignInOptions.builder()
.authFlowType(AuthFlowType.USER_PASSWORD_AUTH)
.build()
Amplify.Auth.signIn(
"username",
"[email protected]",
"password",
options,
{ result ->
Expand All @@ -586,7 +586,7 @@ try {
.authFlowType(AuthFlowType.USER_PASSWORD_AUTH)
.build()
val result = Amplify.Auth.signIn(
username = "username",
username = "[email protected]",
password = "password",
options = options
)
Expand All @@ -603,7 +603,7 @@ try {
AuthSignInOptions options = AWSCognitoAuthSignInOptions.builder()
.authFlowType(AuthFlowType.USER_PASSWORD_AUTH)
.build();
RxAmplify.Auth.signIn("username", "password", options)
RxAmplify.Auth.signIn("[email protected]", "password", options)
.subscribe(
result -> Log.i("AuthQuickstart", "Next step for sign in is " + result.getNextStep()),
error -> Log.e("AuthQuickstart", error.toString())
Expand Down

0 comments on commit 6f26a46

Please sign in to comment.