Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(deriv_auth): [UPM-547] added deriv_passkeys to deriv_auth #488

Merged

Conversation

bassam-deriv
Copy link
Contributor

@bassam-deriv bassam-deriv commented Feb 26, 2024

Clickup link:
Fixes issue: #

This PR contains the following changes:

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

Developers Note (Optional)

Pre-launch Checklist (For PR creator)

As a creator of this PR:

  • ✍️ I have included clickup id and package/app_name in the PR title.
  • 👁️ I have gone through the code and removed any temporary changes (commented lines, prints, debug statements etc.).
  • ⚒️ I have fixed any errors/warnings shown by the analyzer/linter.
  • 📝 I have added documentation, comments and logging wherever required.
  • 🧪 I have added necessary tests for these changes.
  • 🔎 I have ensured all existing tests are passing.

Reviewers

Pre-launch Checklist (For Reviewers)

As a reviewer I ensure that:

  • ✴️ This PR follows the standard PR template.
  • 🪩 The information in this PR properly reflects the code changes.
  • 🧪 All the necessary tests for this PR's are passing.

Pre-launch Checklist (For QA)

  • 👌 It passes the acceptance criteria.

Pre-launch Checklist (For Maintainer)

  • [MAINTAINER_NAME] I make sure this PR fulfills its purpose.

ahrar-deriv and others added 21 commits January 26, 2024 11:57
feat that adds a single entry to the auth package
change deriv_api to dev branch and package_info_plus to version 4
…ges into deriv-auth/feat/single_entry

# Conflicts:
#	packages/deriv_auth/lib/deriv_auth.dart
#	packages/deriv_auth/lib/features/login/presentation/layouts/deriv_login_layout.dart
#	packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart
#	packages/deriv_auth/pubspec.yaml
@bassam-deriv bassam-deriv changed the title feat(deriv_auth): added deriv_passkeys to deriv_auth feat(deriv_auth): [UPM-547] added deriv_passkeys to deriv_auth Feb 28, 2024
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this added inside social_auth folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because it's being used in the social auth service:

BlocProvider(
          create: (context) => SocialAuthCubit(
            socialAuthService: DerivSocialAuthService(
              client: HttpClient(),
              connectionInfo: DerivAuthConnectionInfo(),
            ),
          ),
        ),

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is passed in DerivAuthCubit as well. DerivAuthConnectionInfo is for auth endpoint - oauth.deriv.com, it should be in somewhere common folder.
Screenshot 2024-03-01 at 2 32 44 PM

Comment on lines 3 to 7
import 'package:deriv_passkeys/data/data_sources/deriv_passkeys_data_source.dart';
import 'package:deriv_passkeys/data/mappers/deriv_passkeys_mapper.dart';
import 'package:deriv_passkeys/data/repositories/deriv_passkeys_repository.dart';
import 'package:deriv_passkeys/interactor/services/deriv_passkeys_service.dart';
import 'package:deriv_passkeys/presentation/states/bloc/deriv_passkeys_bloc.dart';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR but can you create a barrel file for deriv_passkeys package?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes i realized i should when i was implementing, thank you for the suggestion!

Comment on lines 25 to 40
deriv_passkeys:
git:
url: [email protected]:regentmarkets/flutter-deriv-packages.git
path: packages/deriv_passkeys
ref: c9b906bc20edbc94d0ca99f2211b142efa3aaf2e

dependency_overrides:
flutter_deriv_api:
git:
url: [email protected]:deriv-com/flutter-deriv-api.git
ref: 64ad3673598ad807b43f751fc2ec7bc5ef01203e
deriv_ui:
git:
url: [email protected]:regentmarkets/flutter-deriv-packages.git
path: packages/deriv_ui
ref: deriv_ui-v0.0.6+2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont forget to change the dependencies before merge.

/// Extension methods for capitalizing [String].
extension Capitalize on String {
/// Capitalize the first letter of the string.
String get capitalize => '${this[0].toUpperCase()}${substring(1)}';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could have been added to StringExtension why did you create a new extension?

child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const ContinueWithPasskeyButton(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This widget is solely for social auth as name suggested. Its better we have a new widget where you use this social auth panel and also add the passkey button and name the widget something else.

Comment on lines 82 to 96
IconButton(
padding: EdgeInsets.zero,
iconSize: ThemeProvider.iconSize40,
icon: Opacity(
opacity: getOpacity(isEnabled: widget.isEnabled),
child: SvgPicture.asset(
_getSocialMediaIcon(socialAuthProvider),
package: 'deriv_auth',
InkWell(
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 12,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
border: Border.all(
Copy link
Contributor

@sahani-deriv sahani-deriv Feb 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add the opacity based on isEnabled.

@sahani-deriv
Copy link
Contributor

Please fix the failing checks.

sahani-deriv and others added 4 commits February 29, 2024 15:51
* chore(release): publish packages

 - [email protected]+4
 - [email protected]

* [create-pull-request] automated change

---------

Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: sahani-deriv <[email protected]>
* feat(deriv_auth): single entry

feat that adds a single entry to the auth package

* chore(deriv_auth): improve some imports

* chore(deriv_auth): change deriv-api to dev branch

change deriv_api to dev branch and package_info_plus to version 4

* feat(deriv_auth): adding login page to single entry

* feat(deriv_auth): single entry login and reset pass added

* feat(deriv_auth): single entry signup page

* chore: setting page fist attempt

* feat(deriv_auith): single entry setting page

* feat(deriv_auth): single entry reset password and merge conflicts

* chore(deriv_auth): code review comments add docs and minor changes

* chore(deriv_auth): change residence to userResidence

* doc(deriv_auth): single entry doc and fix error handling

* chore(deriv_auth): fixing the deriv reset pass layout test

* chore(deriv_auth): change navigation to signupPage in verifyemailpage
@@ -17,7 +17,9 @@ part 'deriv_auth_state.dart';
/// and it is responsible for all login functionality.
class DerivAuthCubit extends Cubit<DerivAuthState> implements DerivAuthIO {
/// Initialize a [DerivAuthCubit].
DerivAuthCubit({required this.authService}) : super(DerivAuthLoadingState());
DerivAuthCubit({
required this.authService,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need the trailing comma

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, i had added another parameter but removed later that's why it's there.

@@ -25,7 +25,7 @@ class LoginPageModel {
final Function(DerivAuthErrorState)? onLoginError;

/// Callback to be called when user is logged in.
final Function(DerivAuthLoggedInState) onLoggedIn;
final Function(BuildContext, DerivAuthLoggedInState) onLoggedIn;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes this PR breaking change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're not going with the single entry implementation in deriv go i'll remove this change so that this PR doesn't have to be breaking.

@bassam-deriv bassam-deriv changed the title feat(deriv_auth): [UPM-547] added deriv_passkeys to deriv_auth feat(deriv_auth)!: [UPM-547] added deriv_passkeys to deriv_auth Apr 1, 2024
@bassam-deriv bassam-deriv changed the title feat(deriv_auth)!: [UPM-547] added deriv_passkeys to deriv_auth feat(deriv_auth): [UPM-547] added deriv_passkeys to deriv_auth Apr 1, 2024
Comment on lines 72 to 82
dependency_overrides:
flutter_deriv_api:
git:
url: [email protected]:deriv-com/flutter-deriv-api.git
ref: dev
deriv_localizations:
git:
url: [email protected]:regentmarkets/flutter-deriv-packages.git
path: packages/deriv_localizations
ref: da897013ecd1f993ad4e696c1d0856d7ebf3758c

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this

git:
url: [email protected]:regentmarkets/flutter-deriv-packages.git
path: packages/deriv_passkeys
ref: 4cb6ab174fc11aac2799475ce4cd874612f7e2da
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be updated

…ve unused import in deriv_get_started_layout_test
@ayaan-deriv ayaan-deriv merged commit 09bd01e into deriv-com:master May 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants