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

Minor change to how LoginForm and RegisterFormV2 is created/modified #1053

Merged
merged 1 commit into from
Jan 4, 2025

Conversation

jwag956
Copy link
Collaborator

@jwag956 jwag956 commented Jan 3, 2025

The default LoginForm now reflects the default configuration - email is required. In init_app() build_login_form() is called that if USERNAME_ENABLE is set will add the username field (as before) and change the email field to be Optional(). This is a small semantic change - prior the email field was not marked as required.

Change the new RegisterFormV2 construction - now the default form reflects the default configuration - new_password and confirm_password are required. From init_app build_register_form() is called and it will: 1) remove password_confirm field if PASSWORD_CONFIRM_REQUIRED is False 2) add username field if USERNAME_ENABLE is True
3) mark the password field as optional if PASSWORD_REQUIRED is False or UNIFIED_SIGNING is True

Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.39%. Comparing base (682eabe) to head (c5f9fba).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1053      +/-   ##
==========================================
- Coverage   98.39%   98.39%   -0.01%     
==========================================
  Files          37       37              
  Lines        4862     4857       -5     
==========================================
- Hits         4784     4779       -5     
  Misses         78       78              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

The default LoginForm now reflects the default configuration - email is required.
In init_app() build_login_form() is called that if USERNAME_ENABLE is set will add the username field (as before)
and change the email field to be Optional(). This is a small semantic change - prior the email field was not marked as required.

Change the new RegisterFormV2 construction - now the default form reflects the default configuration - new_password and confirm_password are required. From init_app build_register_form() is called and it will:
1) remove password_confirm field if PASSWORD_CONFIRM_REQUIRED is False
2) add username field if USERNAME_ENABLE is True
3) mark the password field as optional if PASSWORD_REQUIRED is False or UNIFIED_SIGNING is True

Simplify the PASSWORD_REQUIRED logic - before we always checked for PASSWORD_REQUIRED or UNIFIED_SIGNIN - now - at init_app() time
we throw a ValueError if PASSWORD_REQUIRED==False and UNIFIED_SIGNIN feature not enabled (which is how it has always been documented).
@jwag956 jwag956 merged commit d24e376 into main Jan 4, 2025
21 checks passed
@jwag956 jwag956 deleted the form2 branch January 4, 2025 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant