Skip to content

AuthenticationExample secure password fields - #16000

Merged
macastelaz merged 4 commits into
firebase:mainfrom
macastelaz:sample-auth-app-secure-pw-input
Apr 1, 2026
Merged

AuthenticationExample secure password fields#16000
macastelaz merged 4 commits into
firebase:mainfrom
macastelaz:sample-auth-app-secure-pw-input

Conversation

@macastelaz

Copy link
Copy Markdown
Contributor

Update the AuthenticationExample application to make password fields (login/create account and update password flows) secure and toggle-able. This was flagged in a recent demo where the presenter had to use a basic password like '123456' to avoid screen sharing a more meaningful password.

…(login/create account and update password flows) secure and toggleable. This was flagged in a recent demo where the presenter had to use a basic password like '123456' to avoid screensharing a more meaningful password.
@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@macastelaz
macastelaz requested a review from ncooke3 March 28, 2026 18:41
@ncooke3

ncooke3 commented Mar 28, 2026

Copy link
Copy Markdown
Member

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a secure password toggle feature across the sample application, including a new SwiftUI SecureToggleField and updates to the UIKit UserViewController to support password visibility toggling. It also updates UI tests to handle secure text fields and "Save Password" prompts. Feedback includes addressing a potential runtime crash on iOS 13 due to UIAction usage, replacing sleep calls in UI tests with more robust waits, and improving accessibility for the toggle buttons.

Comment thread FirebaseAuth/Tests/SampleSwift/AuthenticationExample/CustomViews/LoginView.swift Outdated

@ncooke3 ncooke3 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice improvement!

@ncooke3

ncooke3 commented Mar 28, 2026

Copy link
Copy Markdown
Member

For the satisfying the style check, see https://github.com/firebase/firebase-ios-sdk?tab=readme-ov-file#code-formatting

macastelaz added a commit that referenced this pull request Mar 29, 2026
- Add accessibility label to LoginView.swift toggle button
- Fix UserViewController.swift memory leak and icon inversion
- Remove misleading iOS 14+ comment in UserViewController.swift
- Reduce UI tests wait timeout to 1.0 and use XCTNSPredicateExpectation

Co-authored-by: macastelaz <34776182+macastelaz@users.noreply.github.com>
macastelaz added a commit that referenced this pull request Mar 29, 2026
- Fix AuthenticationExampleUITests.swift spacing to fix `scripts/style.sh` failure
- Reduce UI tests wait timeout to 1.0 and use XCTNSPredicateExpectation

Co-authored-by: macastelaz <34776182+macastelaz@users.noreply.github.com>
macastelaz added a commit that referenced this pull request Mar 29, 2026
- Fix memory leak by weakly capturing UI elements in UIAction
- Correct icon toggle logic (`eye` vs `eye.slash`)
- Lower UI wait timeouts for performance
- Address UI test `sleep` flakes with XCTWaiter
- Fix code styling in AuthenticationExampleUITests.swift

Co-authored-by: macastelaz <34776182+macastelaz@users.noreply.github.com>
macastelaz added a commit that referenced this pull request Mar 29, 2026
Co-authored-by: macastelaz <34776182+macastelaz@users.noreply.github.com>
macastelaz added a commit that referenced this pull request Mar 29, 2026
- Restore `passwordSheet.waitForExistence(timeout: 3.0)` to prevent flaky XCUITest taps
- Keep `XCTWaiter` to explicitly block execution until iOS Save Password prompt disappears
- Ensure test element queries use `app.secureTextFields["Password"]`

Co-authored-by: macastelaz <34776182+macastelaz@users.noreply.github.com>
@macastelaz
macastelaz enabled auto-merge (squash) April 1, 2026 20:08
@macastelaz
macastelaz merged commit c2a1e3d into firebase:main Apr 1, 2026
68 of 70 checks passed
@macastelaz
macastelaz deleted the sample-auth-app-secure-pw-input branch April 1, 2026 20:10
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