Skip to content

Conversation

grdsdev
Copy link
Contributor

@grdsdev grdsdev commented Jun 5, 2025

What kind of change does this PR introduce?

Bug fix, feature, docs update, ...

What is the current behavior?

Please link any relevant issues here.

What is the new behavior?

Feel free to include screenshots if it includes visual changes.

Additional context

Add any other context or screenshots.

@grdsdev grdsdev requested a review from Copilot June 5, 2025 18:45
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for phone factor enrollment for MFA in the GoTrue API alongside existing TOTP functionality. Key changes include:

  • Updating tests for MFA enrollment, now grouped under a common "enroll" group.
  • Extending the enrollment response and API to handle an optional phone enrollment.
  • Upgrading the Docker image version for the infrastructure.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/gotrue/test/src/gotrue_mfa_api_test.dart Added tests for phone factor and improved grouping for enroll tests.
packages/gotrue/lib/src/types/mfa.dart Made TOTP enrollment nullable, added PhoneEnrollment, and extended FactorType.
packages/gotrue/lib/src/gotrue_mfa_api.dart Updated enrollment logic to conditionally include issuer or phone in the payload.
infra/gotrue/docker-compose.yml Upgraded the Docker image version.


const AuthMFAEnrollResponse({
required this.id,
required this.type,
required this.totp,
required this.phone,
Copy link
Preview

Copilot AI Jun 5, 2025

Choose a reason for hiding this comment

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

[nitpick] The 'phone' field is marked as required in the constructor even though its type is nullable; consider reviewing whether it should be optional to better reflect scenarios where no phone enrollment occurs.

Suggested change
required this.phone,
this.phone,

Copilot uses AI. Check for mistakes.

@dshukertjr
Copy link
Member

Maybe there can be a syntax that is more friendly to Flutter developers. I opened a PR here to add the same feature that keeps a similar public API as the current implementation.
#1188

@grdsdev grdsdev closed this Jun 6, 2025
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.

2 participants