@@ -1116,7 +1116,7 @@ func socialSignInWithWebUI() -> AnyCancellable {
1116
1116
1117
1117
## Sign in with passwordless methods
1118
1118
1119
- Your application's users can also sign in using passwordless methods. To learn more, visit the [ concepts page for passwordless] ( /[platform]/build-a-backend/auth/concepts/passwordless/ )
1119
+ Your application's users can also sign in using passwordless methods. To learn more, visit the [ concepts page for passwordless] ( /[platform]/build-a-backend/auth/concepts/passwordless/ ) .
1120
1120
1121
1121
### SMS OTP
1122
1122
@@ -1163,7 +1163,7 @@ Amplify.Auth.confirmSignIn(
1163
1163
Amplify . Auth . confirmSignIn(
1164
1164
" 123456" ,
1165
1165
result - > {
1166
- // result.nextStep.signInStep should be "DONE" now
1166
+ // result.getNextStep().getSignInStep() should be "DONE" now
1167
1167
},
1168
1168
error - > Log . e(" AuthQuickstart" , error. toString())
1169
1169
);
@@ -1233,7 +1233,7 @@ RxAmplify.Auth.confirmSignIn(AuthFactorType.SMS_OTP.name())
1233
1233
RxAmplify . Auth . confirmSignIn(" 123456" )
1234
1234
.subscribe(
1235
1235
result - > {
1236
- // result.nextStep.signInStep should be "DONE" now
1236
+ // result.getNextStep().getSignInStep() should be "DONE" now
1237
1237
},
1238
1238
error - > Log . e(" AuthQuickstart" , error. toString())
1239
1239
);
@@ -1367,7 +1367,7 @@ Amplify.Auth.confirmSignIn(
1367
1367
Amplify . Auth . confirmSignIn(
1368
1368
" 123456" ,
1369
1369
result - > {
1370
- // result.nextStep.signInStep should be "DONE" now
1370
+ // result.getNextStep().getSignInStep() should be "DONE" now
1371
1371
},
1372
1372
error - > Log . e(" AuthQuickstart" , error. toString())
1373
1373
);
@@ -1437,7 +1437,7 @@ RxAmplify.Auth.confirmSignIn(AuthFactorType.EMAIL_OTP.name())
1437
1437
RxAmplify . Auth . confirmSignIn(" 123456" )
1438
1438
.subscribe(
1439
1439
result - > {
1440
- // result.nextStep.signInStep should be "DONE" now
1440
+ // result.getNextStep().getSignInStep() should be "DONE" now
1441
1441
},
1442
1442
error - > Log . e(" AuthQuickstart" , error. toString())
1443
1443
);
@@ -1589,32 +1589,100 @@ handleNextSignInStep(nextNextStep);
1589
1589
</InlineFilter >
1590
1590
1591
1591
<InlineFilter filters = { [" android" ]} >
1592
+
1592
1593
<BlockSwitcher >
1593
1594
<Block name = " Java" >
1594
1595
1595
1596
``` java
1596
- // Java code
1597
+ // First confirm the challenge type
1598
+ Amplify . Auth . confirmSignIn(
1599
+ AuthFactorType . PASSWORD , // or PASSWORD_SRP
1600
+ result - > {
1601
+ if (result. getNextStep(). getSignInStep() == AuthSignInStep . CONFIRM_SIGN_IN_WITH_PASSWORD ) {
1602
+ // Show UI to collect password
1603
+ }
1604
+ },
1605
+ error - > Log . e(" AuthQuickstart" , error. toString())
1606
+ );
1607
+
1608
+ // Then pass that password into the confirmSignIn API
1609
+ Amplify . Auth . confirmSignIn(
1610
+ " password" ,
1611
+ result - > {
1612
+ // result.getNextStep().getSignInStep() should be "DONE" now
1613
+ },
1614
+ error - > Log . e(" AuthQuickstart" , error. toString())
1615
+ );
1597
1616
```
1598
1617
1599
1618
</Block >
1600
1619
<Block name = " Kotlin - Callbacks" >
1601
1620
1602
1621
``` kotlin
1603
- // Kotlin code
1622
+ // First confirm the challenge type
1623
+ Amplify .Auth .confirmSignIn(
1624
+ AuthFactorType .PASSWORD .name, // or PASSWORD_SRP
1625
+ { result ->
1626
+ if (result.nextStep.signInStep == AuthSignInStep .CONFIRM_SIGN_IN_WITH_PASSWORD ) {
1627
+ // Show UI to collect password
1628
+ }
1629
+ },
1630
+ { error ->
1631
+ Log .i(" AuthQuickstart" , " Failed to sign in" , error)
1632
+ }
1633
+ )
1634
+
1635
+ // Then pass that password into the confirmSignIn API
1636
+ Amplify .Auth .confirmSignIn(
1637
+ " password" ,
1638
+ { result ->
1639
+ // result.nextStep.signInStep should be "DONE" now
1640
+ },
1641
+ { error ->
1642
+ Log .i(" AuthQuickstart" , " Failed to sign in" , error)
1643
+ }
1644
+ )
1604
1645
```
1605
1646
1606
1647
</Block >
1607
1648
<Block name = " Kotlin - Coroutines" >
1608
1649
1609
1650
``` kotlin
1610
- // Kotlin coroutines code
1651
+ // First confirm the challenge type
1652
+ var result = Amplify .Auth .confirmSignIn(AuthFactorType .PASSWORD .name) // or PASSWORD_SRP
1653
+ if (result.nextStep.signInStep == AuthSignInStep .CONFIRM_SIGN_IN_WITH_PASSWORD ) {
1654
+ // Show UI to collect password
1655
+ }
1656
+
1657
+ // Then pass that password into the confirmSignIn API
1658
+ result = Amplify .Auth .confirmSignIn(" password" )
1659
+
1660
+ // result.nextStep.signInStep should be "DONE" now
1611
1661
```
1612
1662
1613
1663
</Block >
1614
1664
<Block name = " RxJava" >
1615
1665
1616
1666
``` java
1617
- // RxJava code
1667
+ // First confirm the challenge type
1668
+ RxAmplify . Auth . confirmSignIn(AuthFactorType . PASSWORD. name()) // or PASSWORD_SRP
1669
+ .subscribe(
1670
+ result - > {
1671
+ if (result. getNextStep(). getSignInStep() == AuthSignInStep . CONFIRM_SIGN_IN_WITH_PASSWORD ) {
1672
+ // Show UI to collect password
1673
+ }
1674
+ },
1675
+ error - > Log . e(" AuthQuickstart" , error. toString())
1676
+ );
1677
+
1678
+ // Then pass that password into the confirmSignIn API
1679
+ RxAmplify . Auth . confirmSignIn(" password" )
1680
+ .subscribe(
1681
+ result - > {
1682
+ // result.getNextStep().getSignInStep() should be "DONE" now
1683
+ },
1684
+ error - > Log . e(" AuthQuickstart" , error. toString())
1685
+ );
1618
1686
```
1619
1687
1620
1688
</Block >
0 commit comments