Skip to content

Commit

Permalink
fix: use autocomplete for all fields to ensure password manager compa…
Browse files Browse the repository at this point in the history
…tibility (#245)
  • Loading branch information
lukearmstrong authored Feb 2, 2023
1 parent 3dbf612 commit e6cd4e6
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion stubs/default/resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- Email Address -->
<div>
<x-input-label for="email" :value="__('Email')" />
<x-text-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autofocus />
<x-text-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autofocus autocomplete="username" />
<x-input-error :messages="$errors->get('email')" class="mt-2" />
</div>

Expand Down
6 changes: 3 additions & 3 deletions stubs/default/resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<!-- Name -->
<div>
<x-input-label for="name" :value="__('Name')" />
<x-text-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required autofocus />
<x-text-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required autofocus autocomplete="name" />
<x-input-error :messages="$errors->get('name')" class="mt-2" />
</div>

<!-- Email Address -->
<div class="mt-4">
<x-input-label for="email" :value="__('Email')" />
<x-text-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required />
<x-text-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autocomplete="username" />
<x-input-error :messages="$errors->get('email')" class="mt-2" />
</div>

Expand All @@ -34,7 +34,7 @@

<x-text-input id="password_confirmation" class="block mt-1 w-full"
type="password"
name="password_confirmation" required />
name="password_confirmation" required autocomplete="new-password" />

<x-input-error :messages="$errors->get('password_confirmation')" class="mt-2" />
</div>
Expand Down
6 changes: 3 additions & 3 deletions stubs/default/resources/views/auth/reset-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
<!-- Email Address -->
<div>
<x-input-label for="email" :value="__('Email')" />
<x-text-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email', $request->email)" required autofocus />
<x-text-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email', $request->email)" required autofocus autocomplete="username" />
<x-input-error :messages="$errors->get('email')" class="mt-2" />
</div>

<!-- Password -->
<div class="mt-4">
<x-input-label for="password" :value="__('Password')" />
<x-text-input id="password" class="block mt-1 w-full" type="password" name="password" required />
<x-text-input id="password" class="block mt-1 w-full" type="password" name="password" required autocomplete="new-password" />
<x-input-error :messages="$errors->get('password')" class="mt-2" />
</div>

Expand All @@ -25,7 +25,7 @@

<x-text-input id="password_confirmation" class="block mt-1 w-full"
type="password"
name="password_confirmation" required />
name="password_confirmation" required autocomplete="new-password" />

<x-input-error :messages="$errors->get('password_confirmation')" class="mt-2" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<div>
<x-input-label for="email" :value="__('Email')" />
<x-text-input id="email" name="email" type="email" class="mt-1 block w-full" :value="old('email', $user->email)" required autocomplete="email" />
<x-text-input id="email" name="email" type="email" class="mt-1 block w-full" :value="old('email', $user->email)" required autocomplete="username" />
<x-input-error class="mt-2" :messages="$errors->get('email')" />

@if ($user instanceof \Illuminate\Contracts\Auth\MustVerifyEmail && ! $user->hasVerifiedEmail())
Expand Down
1 change: 1 addition & 0 deletions stubs/inertia-react/resources/js/Pages/Auth/Register.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export default function Register() {
name="password_confirmation"
value={data.password_confirmation}
className="mt-1 block w-full"
autoComplete="new-password"
handleChange={onHandleChange}
required
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function UpdateProfileInformation({ mustVerifyEmail, status, clas
value={data.email}
handleChange={(e) => setData('email', e.target.value)}
required
autoComplete="email"
autoComplete="username"
/>

<InputError className="mt-2" message={errors.email} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const form = useForm({
class="mt-1 block w-full"
v-model="form.email"
required
autocomplete="email"
autocomplete="username"
/>

<InputError class="mt-2" :message="form.errors.email" />
Expand Down

0 comments on commit e6cd4e6

Please sign in to comment.