Skip to content

Conversation

@yongdiw
Copy link
Contributor

@yongdiw yongdiw commented Jan 22, 2026

This pull request primarily refactors the NativeAuthSample app to support JIT and MFA, remove the custom Utilities.logMessage logging utility in favor of native console logging, and reorganizes the code for improved modularity and maintainability. Additionally, it updates the .gitignore to better protect sensitive files and cleans up navigation logic in the UI.

yongdiw and others added 3 commits January 22, 2026 16:30
…tion or class'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@yongdiw yongdiw marked this pull request as ready for review January 23, 2026 12:52
Copilot AI review requested due to automatic review settings January 23, 2026 12:52
Copy link
Contributor

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 refactors the NativeAuthSample app to support JIT (Just-In-Time) registration and MFA (Multi-Factor Authentication) flows. It removes the custom Utilities.logMessage utility in favor of native console logging, reorganizes the codebase into a cleaner flows/ directory structure, and introduces shared components for managing JIT and MFA authentication flows.

Changes:

  • Replaced custom logging utility with native console methods
  • Reorganized code into flows/{signin,signup,resetPassword}/ structure with dedicated EventCoordinators and UIManagers
  • Added shared JIT and MFA components with reusable forms and handlers
  • Introduced FormManager and CodeVerificationManager for centralized form management
  • Updated tests to be more lenient with error message assertions
  • Enhanced configuration with MFA support and new helper functions

Reviewed changes

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

Show a summary per file
File Description
test/signup.spec.ts Fixed indentation and updated error assertions to be less strict
test/resetpassword.spec.ts Updated selectors to use shared code verification form and adjusted timeouts
package.json Added Jest flags for better test diagnostics
cors.js Removed verbose logging
app/utilities.js Deleted - replaced with native console
app/ui/ui.js Updated to use console, added debug logging for account updates
app/ui/FormManager.js New - centralized form visibility management
app/ui/CodeVerificationManager.js New - manages shared code verification form across flows
Multiple flow files New coordinator pattern with JIT/MFA delegation
app/shared/* New shared JIT and MFA components
app/index.html Removed duplicate reset password code form, added JIT/MFA forms
app/configParser.js Added MFA claims support
app/authConfig.js Added capabilities configuration
app/app.js Updated imports, improved account initialization
.gitignore Moved native auth config to sample-specific gitignore

Comment on lines +349 to +355
resetButton(button) {
if (!button) return;

button.disabled = false;
if (button.dataset.originalText) {
button.textContent = button.dataset.originalText;
delete button.dataset.originalText;
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The resetButton method signature is inconsistent across UI managers. In SignInUIManager and SignUpUIManager, it takes two parameters (button, originalText), but in ResetPasswordUIManager it only takes one parameter (button). This inconsistency could lead to bugs when calling the method from the event coordinator.

The ResetPasswordEventCoordinator calls this.uiManager.resetButton(resendCodeBtn, originalText) expecting two parameters, but ResetPasswordUIManager.resetButton only accepts one parameter. The second parameter will be silently ignored, which may work but creates an inconsistent API.

Suggested change
resetButton(button) {
if (!button) return;
button.disabled = false;
if (button.dataset.originalText) {
button.textContent = button.dataset.originalText;
delete button.dataset.originalText;
resetButton(button, originalText) {
if (!button) return;
button.disabled = false;
if (button.dataset.originalText) {
button.textContent = button.dataset.originalText;
delete button.dataset.originalText;
} else if (typeof originalText === "string") {
button.textContent = originalText;

Copilot uses AI. Check for mistakes.
@yongdiw yongdiw merged commit 1887ed4 into dev Jan 23, 2026
13 checks passed
@yongdiw yongdiw deleted the yongdi/update-app-changes branch January 23, 2026 17:50
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