Skip to content

Commit

Permalink
docs(auth): Remove unnecessary breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Dillon Nys committed Jun 28, 2023
1 parent 255558f commit 6b85d39
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
14 changes: 0 additions & 14 deletions packages/amplify_core/doc/lib/auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ Future<void> _handleSignUpResult(SignUpResult result) async {
case AuthSignUpStep.confirmSignUp:
final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
_handleCodeDelivery(codeDeliveryDetails);
break;
case AuthSignUpStep.done:
safePrint('Sign up is complete');
break;
}
}
// #enddocregion handle-signup
Expand Down Expand Up @@ -114,27 +112,23 @@ Future<void> _handleSignInResult(SignInResult result) async {
case AuthSignInStep.confirmSignInWithSmsMfaCode:
final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
_handleCodeDelivery(codeDeliveryDetails);
break;
// #enddocregion handle-confirm-signin-sms
// #docregion handle-confirm-signin-new-password
case AuthSignInStep.confirmSignInWithNewPassword:
safePrint('Enter a new password to continue signing in');
break;
// #enddocregion handle-confirm-signin-new-password
// #docregion handle-confirm-signin-custom-challenge
case AuthSignInStep.confirmSignInWithCustomChallenge:
final parameters = result.nextStep.additionalInfo;
final prompt = parameters['prompt']!;
safePrint(prompt);
break;
// #enddocregion handle-confirm-signin-custom-challenge
// #docregion handle-confirm-signin-reset-password
case AuthSignInStep.resetPassword:
final resetResult = await Amplify.Auth.resetPassword(
username: username,
);
await _handleResetPasswordResult(resetResult);
break;
// #enddocregion handle-confirm-signin-reset-password
// #docregion handle-confirm-signin-confirm-signup
case AuthSignInStep.confirmSignUp:
Expand All @@ -143,12 +137,10 @@ Future<void> _handleSignInResult(SignInResult result) async {
username: username,
);
_handleCodeDelivery(resendResult.codeDeliveryDetails);
break;
// #enddocregion handle-confirm-signin-confirm-signup
// #docregion handle-confirm-signin-done
case AuthSignInStep.done:
safePrint('Sign in is complete');
break;
// #enddocregion handle-confirm-signin-done
// #docregion handle-signin, handle-confirm-signin-sms, handle-confirm-signin-new-password, handle-confirm-signin-custom-challenge, handle-confirm-signin-reset-password, handle-confirm-signin-confirm-signup, handle-confirm-signin-done
}
Expand Down Expand Up @@ -188,10 +180,8 @@ Future<void> _handleResetPasswordResult(ResetPasswordResult result) async {
case AuthResetPasswordStep.confirmResetPasswordWithCode:
final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
_handleCodeDelivery(codeDeliveryDetails);
break;
case AuthResetPasswordStep.done:
safePrint('Successfully reset password');
break;
}
}
// #enddocregion handle-reset-password
Expand Down Expand Up @@ -344,10 +334,8 @@ void _handleUpdateUserAttributeResult(
case AuthUpdateAttributeStep.confirmAttributeWithCode:
final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
_handleCodeDelivery(codeDeliveryDetails);
break;
case AuthUpdateAttributeStep.done:
safePrint('Successfully updated attribute');
break;
}
}
// #enddocregion handle-update-user-attribute
Expand Down Expand Up @@ -389,10 +377,8 @@ Future<void> updateUserAttributes() async {
case AuthUpdateAttributeStep.confirmAttributeWithCode:
final destination = value.nextStep.codeDeliveryDetails?.destination;
safePrint('Confirmation code sent to $destination for $key');
break;
case AuthUpdateAttributeStep.done:
safePrint('Update completed for $key');
break;
}
});
} on AuthException catch (e) {
Expand Down
18 changes: 0 additions & 18 deletions packages/amplify_core/lib/src/category/amplify_auth_category.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,8 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
/// case AuthSignUpStep.confirmSignUp:
/// final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
/// _handleCodeDelivery(codeDeliveryDetails);
/// break;
/// case AuthSignUpStep.done:
/// safePrint('Sign up is complete');
/// break;
/// }
/// }
/// ```
Expand Down Expand Up @@ -190,10 +188,8 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
/// case AuthSignUpStep.confirmSignUp:
/// final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
/// _handleCodeDelivery(codeDeliveryDetails);
/// break;
/// case AuthSignUpStep.done:
/// safePrint('Sign up is complete');
/// break;
/// }
/// }
/// ```
Expand Down Expand Up @@ -337,7 +333,6 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
/// case AuthSignInStep.confirmSignInWithSmsMfaCode:
/// final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
/// _handleCodeDelivery(codeDeliveryDetails);
/// break;
/// // ···
/// }
/// }
Expand All @@ -363,7 +358,6 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
/// // ···
/// case AuthSignInStep.confirmSignInWithNewPassword:
/// safePrint('Enter a new password to continue signing in');
/// break;
/// // ···
/// }
/// }
Expand All @@ -383,7 +377,6 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
/// final parameters = result.nextStep.additionalInfo;
/// final prompt = parameters['prompt']!;
/// safePrint(prompt);
/// break;
/// // ···
/// }
/// }
Expand All @@ -403,7 +396,6 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
/// username: username,
/// );
/// await _handleResetPasswordResult(resetResult);
/// break;
/// // ···
/// }
/// }
Expand All @@ -416,10 +408,8 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
/// case AuthResetPasswordStep.confirmResetPasswordWithCode:
/// final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
/// _handleCodeDelivery(codeDeliveryDetails);
/// break;
/// case AuthResetPasswordStep.done:
/// safePrint('Successfully reset password');
/// break;
/// }
/// }
/// ```
Expand All @@ -439,7 +429,6 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
/// username: username,
/// );
/// _handleCodeDelivery(resendResult.codeDeliveryDetails);
/// break;
/// // ···
/// }
/// }
Expand All @@ -465,7 +454,6 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
/// // ···
/// case AuthSignInStep.done:
/// safePrint('Sign in is complete');
/// break;
/// // ···
/// }
/// }
Expand Down Expand Up @@ -704,10 +692,8 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
/// case AuthResetPasswordStep.confirmResetPasswordWithCode:
/// final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
/// _handleCodeDelivery(codeDeliveryDetails);
/// break;
/// case AuthResetPasswordStep.done:
/// safePrint('Successfully reset password');
/// break;
/// }
/// }
/// ```
Expand Down Expand Up @@ -1045,10 +1031,8 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
/// case AuthUpdateAttributeStep.confirmAttributeWithCode:
/// final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!;
/// _handleCodeDelivery(codeDeliveryDetails);
/// break;
/// case AuthUpdateAttributeStep.done:
/// safePrint('Successfully updated attribute');
/// break;
/// }
/// }
/// ```
Expand Down Expand Up @@ -1108,10 +1092,8 @@ class AuthCategory extends AmplifyCategory<AuthPluginInterface> {
/// case AuthUpdateAttributeStep.confirmAttributeWithCode:
/// final destination = value.nextStep.codeDeliveryDetails?.destination;
/// safePrint('Confirmation code sent to $destination for $key');
/// break;
/// case AuthUpdateAttributeStep.done:
/// safePrint('Update completed for $key');
/// break;
/// }
/// });
/// } on AuthException catch (e) {
Expand Down

0 comments on commit 6b85d39

Please sign in to comment.