An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
feat(auth): autofocus auth form fields and profile 2FA OTP (#11324)
Vinicius Cruzce7d17b7c51c
diff --git a/resources/views/components/forms/input.blade.php b/resources/views/components/forms/input.blade.phpindex f49864ddfb..4a94d3e02e 100644--- a/resources/views/components/forms/input.blade.php+++ b/resources/views/components/forms/input.blade.php@@ -37,7 +37,7 @@@readonly($readonly) @disabled($disabled) id="{{ $htmlId }}"name="{{ $name }}" placeholder="{{ $attributes->get('placeholder') }}"aria-placeholder="{{ $attributes->get('placeholder') }}"- @if ($autofocus) x-ref="autofocusInput" @endif>+ @if ($autofocus) x-ref="autofocusInput" autofocus @endif>@if ($allowToPeak)<button type="button" x-on:click="type = type === 'password' ? 'text' : 'password'"class="password-toggle flex absolute inset-y-0 right-0 z-10 items-center pr-2 cursor-pointer text-neutral-500 hover:text-black dark:text-neutral-400 dark:hover:text-white"@@ -60,7 +60,7 @@maxlength="{{ $attributes->get('maxlength') }}"@if ($htmlId !== 'null') id={{ $htmlId }} @endif name="{{ $name }}"placeholder="{{ $attributes->get('placeholder') }}"- @if ($autofocus) x-ref="autofocusInput" @endif>+ @if ($autofocus) x-ref="autofocusInput" autofocus @endif>@endif@if (!$label && $helper)<x-helper :helper="$helper" />diff --git a/resources/views/livewire/profile/index.blade.php b/resources/views/livewire/profile/index.blade.phpindex 66f1dc5232..cc8c094b1e 100644--- a/resources/views/livewire/profile/index.blade.php+++ b/resources/views/livewire/profile/index.blade.php@@ -249,9 +249,10 @@</p></div><form action="/user/confirmed-two-factor-authentication" method="POST"- class="flex items-end gap-2">+ class="flex items-end gap-2"+ x-init="$nextTick(() => $el.querySelector('input[name=code]')?.focus())">@csrf- <x-forms.input type="text" inputmode="numeric" pattern="[0-9]*" id="code"+ <x-forms.input name="code" type="text" inputmode="numeric" pattern="[0-9]*" id="code"label="One-time code" required /><x-forms.button type="submit">Validate 2FA</x-forms.button></form>