@@ -543,7 +543,7 @@ Your application's users can also sign up using passwordless methods. To learn m
543
543
``` typescript
544
544
// Sign up using a phone number
545
545
const { nextStep : signUpNextStep } = await signUp ({
546
- username: ' james ' ,
546
+ username: ' hello ' ,
547
547
options: {
548
548
userAttributes: {
549
549
phone_number: ' +15555551234' ,
@@ -566,7 +566,7 @@ if (signUpNextStep.signUpStep === 'CONFIRM_SIGN_UP') {
566
566
567
567
// Confirm sign up with the OTP received
568
568
const { nextStep : confirmSignUpNextStep } = await confirmSignUp ({
569
- username: ' james ' ,
569
+ username: ' hello ' ,
570
570
confirmationCode: ' 123456' ,
571
571
});
572
572
@@ -691,10 +691,10 @@ func confirmSignUp(for username: String, with confirmationCode: String) -> AnyCa
691
691
``` typescript
692
692
// Sign up using an email address
693
693
const { nextStep : signUpNextStep } = await signUp ({
694
- username: ' james ' ,
694
+ username: ' hello ' ,
695
695
options: {
696
696
userAttributes: {
697
- email: ' james @example.com' ,
697
+ email: ' hello @example.com' ,
698
698
},
699
699
},
700
700
});
@@ -714,7 +714,7 @@ if (signUpNextStep.signUpStep === 'CONFIRM_SIGN_UP') {
714
714
715
715
// Confirm sign up with the OTP received
716
716
const { nextStep : confirmSignUpNextStep } = await confirmSignUp ({
717
- username: ' james ' ,
717
+ username: ' hello ' ,
718
718
confirmationCode: ' 123456' ,
719
719
});
720
720
@@ -837,19 +837,44 @@ func confirmSignUp(for username: String, with confirmationCode: String) -> AnyCa
837
837
<InlineFilter filters = { [" angular" , " javascript" , " nextjs" , " react" , " react-native" , " vue" ]} >
838
838
839
839
``` typescript
840
- // Confirm sign up with the OTP received and auto sign in
840
+ // Call `signUp` API with `USER_AUTH` as the authentication flow type for `autoSignIn`
841
+ const { nextStep : signUpNextStep } = await signUp ({
842
+ username: ' hello' ,
843
+ options: {
844
+ userAttributes: {
845
+
846
+ phone_number: ' +15555551234' ,
847
+ },
848
+ autoSignIn: {
849
+ authFlowType: ' USER_AUTH' ,
850
+ },
851
+ },
852
+ });
853
+
854
+ if (signUpNextStep .signUpStep === ' CONFIRM_SIGN_UP' ) {
855
+ console .log (
856
+ ` Code Delivery Medium: ${signUpNextStep .codeDeliveryDetails .deliveryMedium } ` ,
857
+ );
858
+ console .log (
859
+ ` Code Delivery Destination: ${signUpNextStep .codeDeliveryDetails .destination } ` ,
860
+ );
861
+ }
862
+
863
+ // Call `confirmSignUp` API with the OTP received
841
864
const { nextStep : confirmSignUpNextStep } = await confirmSignUp ({
842
- username: ' james ' ,
865
+ username: ' hello ' ,
843
866
confirmationCode: ' 123456' ,
844
867
});
845
868
846
869
if (confirmSignUpNextStep .signUpStep === ' COMPLETE_AUTO_SIGN_IN' ) {
870
+ // Call `autoSignIn` API to complete the flow
847
871
const { nextStep } = await autoSignIn ();
848
872
849
873
if (nextStep .signInStep === ' DONE' ) {
850
874
console .log (' Successfully signed in.' );
851
875
}
852
876
}
877
+
853
878
```
854
879
</InlineFilter >
855
880
<InlineFilter filters = { [" android" ]} >
0 commit comments