-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(js): expand passwordless examples for multistep sign in, autosig…
…n in, and switching flows (#8138) * add additional detail to switching auth flows page * expand autosignin examples * clarify language * fix wording * add passwordless steps to multistep sign in page * tweak language * Update src/pages/[platform]/build-a-backend/auth/connect-your-frontend/switching-authentication-flows/index.mdx Co-authored-by: Parker Scanlon <[email protected]> --------- Co-authored-by: Parker Scanlon <[email protected]>
- Loading branch information
Showing
3 changed files
with
153 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -543,7 +543,7 @@ Your application's users can also sign up using passwordless methods. To learn m | |
```typescript | ||
// Sign up using a phone number | ||
const { nextStep: signUpNextStep } = await signUp({ | ||
username: 'james', | ||
username: 'hello', | ||
options: { | ||
userAttributes: { | ||
phone_number: '+15555551234', | ||
|
@@ -566,7 +566,7 @@ if (signUpNextStep.signUpStep === 'CONFIRM_SIGN_UP') { | |
|
||
// Confirm sign up with the OTP received | ||
const { nextStep: confirmSignUpNextStep } = await confirmSignUp({ | ||
username: 'james', | ||
username: 'hello', | ||
confirmationCode: '123456', | ||
}); | ||
|
||
|
@@ -852,10 +852,10 @@ func confirmSignUp(for username: String, with confirmationCode: String) -> AnyCa | |
```typescript | ||
// Sign up using an email address | ||
const { nextStep: signUpNextStep } = await signUp({ | ||
username: 'james', | ||
username: 'hello', | ||
options: { | ||
userAttributes: { | ||
email: 'james@example.com', | ||
email: 'hello@example.com', | ||
}, | ||
}, | ||
}); | ||
|
@@ -875,7 +875,7 @@ if (signUpNextStep.signUpStep === 'CONFIRM_SIGN_UP') { | |
|
||
// Confirm sign up with the OTP received | ||
const { nextStep: confirmSignUpNextStep } = await confirmSignUp({ | ||
username: 'james', | ||
username: 'hello', | ||
confirmationCode: '123456', | ||
}); | ||
|
||
|
@@ -1158,19 +1158,44 @@ func confirmSignUp(for username: String, with confirmationCode: String) -> AnyCa | |
<InlineFilter filters={["angular", "javascript", "nextjs", "react", "react-native", "vue"]}> | ||
|
||
```typescript | ||
// Confirm sign up with the OTP received and auto sign in | ||
// Call `signUp` API with `USER_AUTH` as the authentication flow type for `autoSignIn` | ||
const { nextStep: signUpNextStep } = await signUp({ | ||
username: 'hello', | ||
options: { | ||
userAttributes: { | ||
email: '[email protected]', | ||
phone_number: '+15555551234', | ||
}, | ||
autoSignIn: { | ||
authFlowType: 'USER_AUTH', | ||
}, | ||
}, | ||
}); | ||
|
||
if (signUpNextStep.signUpStep === 'CONFIRM_SIGN_UP') { | ||
console.log( | ||
`Code Delivery Medium: ${signUpNextStep.codeDeliveryDetails.deliveryMedium}`, | ||
); | ||
console.log( | ||
`Code Delivery Destination: ${signUpNextStep.codeDeliveryDetails.destination}`, | ||
); | ||
} | ||
|
||
// Call `confirmSignUp` API with the OTP received | ||
const { nextStep: confirmSignUpNextStep } = await confirmSignUp({ | ||
username: 'james', | ||
username: 'hello', | ||
confirmationCode: '123456', | ||
}); | ||
|
||
if (confirmSignUpNextStep.signUpStep === 'COMPLETE_AUTO_SIGN_IN') { | ||
// Call `autoSignIn` API to complete the flow | ||
const { nextStep } = await autoSignIn(); | ||
|
||
if (nextStep.signInStep === 'DONE') { | ||
console.log('Successfully signed in.'); | ||
} | ||
} | ||
|
||
``` | ||
</InlineFilter> | ||
<InlineFilter filters={["android"]}> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters