diff --git a/packages/rx_bloc_cli/doc/assets/images/password_reset.png b/packages/rx_bloc_cli/doc/assets/images/password_reset.png new file mode 100644 index 000000000..b65b11e5b Binary files /dev/null and b/packages/rx_bloc_cli/doc/assets/images/password_reset.png differ diff --git a/packages/rx_bloc_cli/doc/assets/images/password_reset_confirmation.png b/packages/rx_bloc_cli/doc/assets/images/password_reset_confirmation.png new file mode 100644 index 000000000..db972abbc Binary files /dev/null and b/packages/rx_bloc_cli/doc/assets/images/password_reset_confirmation.png differ diff --git a/packages/rx_bloc_cli/doc/assets/images/password_reset_request.png b/packages/rx_bloc_cli/doc/assets/images/password_reset_request.png new file mode 100644 index 000000000..2d1c8829f Binary files /dev/null and b/packages/rx_bloc_cli/doc/assets/images/password_reset_request.png differ diff --git a/packages/rx_bloc_cli/doc/assets/images/password_reset_success.png b/packages/rx_bloc_cli/doc/assets/images/password_reset_success.png new file mode 100644 index 000000000..6b0a0b016 Binary files /dev/null and b/packages/rx_bloc_cli/doc/assets/images/password_reset_success.png differ diff --git a/packages/rx_bloc_cli/lib/src/models/generator_arguments_provider.dart b/packages/rx_bloc_cli/lib/src/models/generator_arguments_provider.dart index 77c1aa1c1..ed45a4cd7 100644 --- a/packages/rx_bloc_cli/lib/src/models/generator_arguments_provider.dart +++ b/packages/rx_bloc_cli/lib/src/models/generator_arguments_provider.dart @@ -33,7 +33,10 @@ class GeneratorArgumentsProvider { final projectConfiguration = _readProjectConfiguration(); final authConfiguration = _readAuthConfiguration(); final featureConfiguration = _readFeatureConfiguration(authConfiguration); - final showcaseConfiguration = _readShowcaseConfiguration(authConfiguration); + final showcaseConfiguration = _readShowcaseConfiguration( + authConfiguration, + featureConfiguration, + ); return GeneratorArguments( outputDirectory: _outputDirectory, projectConfiguration: projectConfiguration, @@ -212,15 +215,16 @@ class GeneratorArgumentsProvider { /// region Showcase Configuration ShowcaseConfiguration _readShowcaseConfiguration( - AuthConfiguration authConfiguration) { + AuthConfiguration authConfiguration, + FeatureConfiguration featureConfiguration, + ) { // Counter final counterEnabled = _reader.read(CreateCommandArguments.counter); // Deep links var deepLinkEnabled = _reader.read(CreateCommandArguments.deepLink); // Onboarding/Registration - final onboardingEnabled = - _reader.read(CreateCommandArguments.onboarding); + final onboardingEnabled = featureConfiguration.onboardingEnabled; if (onboardingEnabled && !deepLinkEnabled) { _logger.warn('Deep links enabled, due to Onboarding feature requirement'); deepLinkEnabled = true; diff --git a/packages/rx_bloc_cli/mason_templates/bricks/feature_password_reset/README.md b/packages/rx_bloc_cli/mason_templates/bricks/feature_password_reset/README.md index 2f2e1fab7..d8c688296 100644 --- a/packages/rx_bloc_cli/mason_templates/bricks/feature_password_reset/README.md +++ b/packages/rx_bloc_cli/mason_templates/bricks/feature_password_reset/README.md @@ -1,13 +1,28 @@ # feature_password_reset -[![Powered by Mason](https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge)](https://github.com/felangel/mason) +[![Powered by Mason](https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge)](https://github.com/felangel/mason) -A brick designed to bootstrap the integration of a robust Onboarding/Registration flow into your application. This feature enables users to register using their email, password, and phone number, with intuitive confirmation pages for each step. Users can also resume the process at any time during the confirmation steps. +A brick designed to bootstrap the integration of a robust Password Reset flow into your application. This feature enables users to reset their password using their email, with intuitive confirmation pages for each step. + +Feature Password Reset Request +Feature Password Reset Email Confirmation +Feature Password Reset +Feature Password Reset Success + +## Features + +- **Password Reset Request**: Allows users to request a password reset using their email. +- **Email Confirmation**: Lets the user open their email client & resend a new link. (contains mock links to be used for testing) +- **Password Change**: Allows users to change their password after opening the link. ## Authentication -This feature includes basic input validation and authentication infrastructure related to the onboarding process. Users can log in using their email and password as credentials. +This feature includes basic input validation and authentication infrastructure related to the password reset process. Users can reset their password using their email as credentials. + +## Important Note + +This brick is a bootstrap tool meant to make kickstarting a password reset flow faster. It includes only a basic example backend and does not actually send confirmation emails. It is expected that a "real" backend would handle these tasks in the future. ## API Contracts -For detailed API contracts and to better understand the flow, please refer to the [API Contracts](__brick__/docs/onboarding_api_contracts.md) document. +For detailed API contracts and to better understand the flow, please refer to the [API Contracts](__brick__/docs/forgotten_pass_api_contracts.md) document. \ No newline at end of file diff --git a/packages/rx_bloc_cli/test/models/generator_arguments_provider_test.dart b/packages/rx_bloc_cli/test/models/generator_arguments_provider_test.dart index 578bfbe06..bbb73db07 100644 --- a/packages/rx_bloc_cli/test/models/generator_arguments_provider_test.dart +++ b/packages/rx_bloc_cli/test/models/generator_arguments_provider_test.dart @@ -140,5 +140,20 @@ void main() { verify(logger.warn(any)).called(3); }); + + test('should return updated values if forgotten pass is enabled', () { + configureArgumentValues(Stub.forgottenPassEnabled); + + verifyNever(logger.warn(any)); + final generatorArguments = sut.readGeneratorArguments(); + + expect(generatorArguments.profileEnabled, isTrue); + expect(generatorArguments.loginEnabled, isTrue); + expect(generatorArguments.deepLinkEnabled, isTrue); + expect(generatorArguments.onboardingEnabled, isTrue); + expect(generatorArguments.forgottenPassword, isTrue); + + verify(logger.warn(any)).called(4); + }); }); } diff --git a/packages/rx_bloc_cli/test/stub.dart b/packages/rx_bloc_cli/test/stub.dart index a3af1a30a..4e7c26609 100644 --- a/packages/rx_bloc_cli/test/stub.dart +++ b/packages/rx_bloc_cli/test/stub.dart @@ -94,6 +94,14 @@ final class Stub { ..[CreateCommandArguments.login.name] = false ..[CreateCommandArguments.profile.name] = false; + static Map get forgottenPassEnabled => + Map.from(Stub.defaultValues) + ..[CreateCommandArguments.forgottenPassword.name] = true + ..[CreateCommandArguments.onboarding.name] = false + ..[CreateCommandArguments.deepLink.name] = false + ..[CreateCommandArguments.login.name] = false + ..[CreateCommandArguments.profile.name] = false; + static final generatorArgumentsAllEnabled = GeneratorArguments( outputDirectory: Directory('some/output_directory'), projectConfiguration: ProjectConfiguration(