Feature: Disable auto-focus on email input in Universal Login
Description: My main concern is to be able to remove the autofocus on the email input as I want to show the login without opening the keyboard or the autofill which automatically fills the email and password.
Use-case: I’m currently work with .NET MAUI and in iOS when the Safari browser is open, automatically the email input is focused. I would like to prevent this.
The auto-focus is very annoying. The keyboard popping up hides the simpler Apple/Google login options, pushing most users to the more difficult, less-reliable option of email+password.
But in the meantime, I got tired of waiting. I still didn’t want to maintain a custom login screen, so I found a hack:
Use the Management API with update:branding permission to post to <your-custom-domain>/api/v2/branding/templates/universal-login with the following HTML template. I started with the most basic sample template + a de-focus script on load.
The universal login styles apply as normal… except page background image! Strangely the page-background-image var is only available on a div wrapper with generated class names, missing when using a page template… so I had to manually add my background image.
You may get a slight focus/unfocus flicker, but it works. Reasonably robust as it doesn’t look for any auth0 element IDs, just de-focusses whatever is active.