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

Provide fake username on login form #2419

Merged
merged 2 commits into from
Dec 28, 2022
Merged

Provide fake username on login form #2419

merged 2 commits into from
Dec 28, 2022

Conversation

yubiuser
Copy link
Member

@yubiuser yubiuser commented Nov 6, 2022

What does this PR aim to accomplish?:

When a password is set for the web interface, we use autocomplete="current-password" on the password login form to allow browsers and password managers to auto-fill the input field. This works well with e.g. Firefox, but fails on Chrome (see #2418).
To fix this, we add a hidden input field providing a fake username (pi.hole).


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

  • I have read the above and my PR is ready for review. Check this box to confirm

@yubiuser yubiuser marked this pull request as draft November 6, 2022 09:13
@yubiuser
Copy link
Member Author

yubiuser commented Nov 6, 2022

Note to self: get rid of Chrome's autofill CSS modifications of the input box

@yubiuser yubiuser linked an issue Nov 6, 2022 that may be closed by this pull request
@rdwebdesign
Copy link
Member

This PR will solve the issue, but I think this is a browser bug introduced recently.

To be sure, I tested using the current browser version and 2 different Pi-hole versions (docker image latest and 2022.02) and the password is not saved in both cases.

Without your PR, I was able to save the password on both browsers using the normal procedure, but I needed to type an username:

  • access the page, type the password and click on "Log in" button;
  • the browser will show a pop up to save the password;
  • type any username and click "save";
  • the password will be saved.

@yubiuser
Copy link
Member Author

Do you think I should not proceed with this PR as this is an external "bug" (and we could simply wait until they fix it)? Maybe they don't see this as a bug, but as a feature and won't fix it ever?

Signed-off-by: Christian König <ckoenig@posteo.de>
Signed-off-by: Christian König <ckoenig@posteo.de>
@yubiuser yubiuser marked this pull request as ready for review December 28, 2022 16:13
@yubiuser yubiuser requested review from rdwebdesign and a team December 28, 2022 16:13
@yubiuser yubiuser added the PR: Approval Required Open Pull Request, needs approval label Dec 28, 2022
@yubiuser
Copy link
Member Author

Ready for review.

I adjusted the CSS to overwrite the auto-fill style on Chrome browsers.

@yubiuser yubiuser merged commit ae90d93 into devel Dec 28, 2022
@yubiuser yubiuser deleted the login branch December 28, 2022 18:56
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-ftl-v5-20-1-web-v5-18-1-and-core-v5-15-released/60495/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Approval Required Open Pull Request, needs approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chrome Password no longer autopopulating
3 participants