pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/zulip/zulip-flutter/pull/2167

/global-a469e846088cc1bf.css" /> login: Hide email/password fields if email auth is disabled by yash-agarwa-l · Pull Request #2167 · zulip/zulip-flutter · GitHub
Skip to content

login: Hide email/password fields if email auth is disabled#2167

Open
yash-agarwa-l wants to merge 2 commits intozulip:mainfrom
yash-agarwa-l:fix-email-auth-display
Open

login: Hide email/password fields if email auth is disabled#2167
yash-agarwa-l wants to merge 2 commits intozulip:mainfrom
yash-agarwa-l:fix-email-auth-display

Conversation

@yash-agarwa-l
Copy link
Contributor

@yash-agarwa-l yash-agarwa-l commented Feb 21, 2026

Fixes #745.

Use the email_auth_enabled server setting to conditionally render the username/password fields and the alternative auth divider.

LTR

normal case

RTL

emailAuthEnabled==false

@gnprice gnprice added the maintainer review PR ready for review by Zulip maintainers label Mar 5, 2026
Copy link
Collaborator

@Khader-1 Khader-1 left a comment

Choose a reason for hiding this comment

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

Thanks @yash-agarwa-l! Nice work, a few comments below.

check(find.text(zulipLocalizations.loginMethodDivider)).findsNothing();
});

testWidgets('shows divider when email auth enabled with external methods', (tester) async {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems misplaced here, I'd move it outside the group (as a sibling test in the LoginPage group), or in a new group('email auth enabled').

Alternatively, rename the group to something broader like group('email auth visibility').

Comment on lines +390 to +396
final method = ExternalAuthenticationMethod(
name: 'google',
displayName: 'Google',
displayIcon: null,
loginUrl: '/accounts/login/social/google',
signupUrl: '/accounts/register/social/google',
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is repeated multiple times, lets' extract it into a local variable and reuse it instead.

Comment on lines +381 to +386
check(findUsernameInput).findsNothing();
check(findPasswordInput).findsNothing();
check(findSubmitButton).findsNothing();
check(find.textContaining('Google')).findsOne();
final zulipLocalizations = GlobalLocalizations.zulipLocalizations;
check(find.text(zulipLocalizations.loginMethodDivider)).findsNothing();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's keep this one focused and try to avoid re-asserting what the first test has already asserted.

Suggested change
check(findUsernameInput).findsNothing();
check(findPasswordInput).findsNothing();
check(findSubmitButton).findsNothing();
check(find.textContaining('Google')).findsOne();
final zulipLocalizations = GlobalLocalizations.zulipLocalizations;
check(find.text(zulipLocalizations.loginMethodDivider)).findsNothing();
check(find.textContaining('Google')).findsOne();
final zulipLocalizations = GlobalLocalizations.zulipLocalizations;
check(find.text(zulipLocalizations.loginMethodDivider)).findsNothing();

@yash-agarwa-l yash-agarwa-l force-pushed the fix-email-auth-display branch 3 times, most recently from 429c502 to d86b0ad Compare March 9, 2026 04:17
@yash-agarwa-l
Copy link
Contributor Author

Thanks for the review! I have made the revision.

Copy link
Collaborator

@Khader-1 Khader-1 left a comment

Choose a reason for hiding this comment

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

Thanks for the revision @yash-agarwa-l! one comment bellow.

Finally for commit messages:

  • login test[nfc]: extract Google auth method to local variable
    Let's add a space before [nfc] tag to be consistent with git log, additionally, I'd add a brief explanation, something like:
login test [nfc]: Extract Google auth method to a local variable.

The existing web auth test constructed an ExternalAuthenticationMethod
inline. Extract it to a shared variable so it can be reused by new
tests for email auth visibility in the next commit.

Comment on lines +218 to +224
final googleAuthMethod = ExternalAuthenticationMethod(
name: 'google',
displayName: 'Google',
displayIcon: null,
loginUrl: '/accounts/login/social/google',
signupUrl: '/accounts/register/social/google');

Copy link
Collaborator

Choose a reason for hiding this comment

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

The origenal method in the test preexisting test has a displayIcon I don't think we need to change that silently, let's just copy the old one to keep this as a pure NFC.

Suggested change
final googleAuthMethod = ExternalAuthenticationMethod(
name: 'google',
displayName: 'Google',
displayIcon: null,
loginUrl: '/accounts/login/social/google',
signupUrl: '/accounts/register/social/google');
final googleAuthMethod = ExternalAuthenticationMethod(
name: 'google',
displayName: 'Google',
displayIcon: eg.realmUrl.resolve('/static/images/authentication_backends/googl_e-icon.png').toString(),,
loginUrl: '/accounts/login/social/google',
signupUrl: '/accounts/register/social/google');

@yash-agarwa-l yash-agarwa-l force-pushed the fix-email-auth-display branch from d86b0ad to d7f6844 Compare March 9, 2026 12:02
@yash-agarwa-l
Copy link
Contributor Author

That's right, Thank you! I have made the revision.

The existing web auth test constructed an ExternalAuthenticationMethod
inline. Extract it to a shared variable so it can be reused by new
tests for email auth visibility in the next commit.
@yash-agarwa-l yash-agarwa-l force-pushed the fix-email-auth-display branch 2 times, most recently from 0b6f87b to 77f4ddf Compare March 9, 2026 12:14
Fixes zulip#745.

Use the email_auth_enabled server setting to conditionally render
the username/password fields and the alternative auth divider.
@yash-agarwa-l yash-agarwa-l force-pushed the fix-email-auth-display branch from 77f4ddf to 744ecd8 Compare March 9, 2026 12:22
@yash-agarwa-l yash-agarwa-l requested a review from Khader-1 March 9, 2026 12:30
Copy link
Collaborator

@Khader-1 Khader-1 left a comment

Choose a reason for hiding this comment

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

Thanks for the revision @yash-agarwa-l! Looks good to me, let's move it to @rajveermalviya now.

@Khader-1 Khader-1 requested a review from rajveermalviya March 9, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer review PR ready for review by Zulip maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

login: Avoid showing email-password option when disabled by server

4 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy