Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

monstajamss's avatar

Problem Authenticating with Email/Username in Laravel Inertia and Jetstream

I am trying to authenticate my laravel application using username and email

Login.vue

   <div>
                <jet-label for="username" value="Username or Email" />
                <jet-input id="username" type="text" class="mt-1 block w-full" v-model="form.email" required autofocus />
   </div>

 data() {
            return {
                form: this.$inertia.form({
                    email: '',
                    username: '',
                    password: '',
                    remember: false
                })
            }
        },

I have the below in config/fortify.php

'username' => 'email',

    'email' => 'email',

I keep getting this error when i try to use username to log in

These credentials do not match our records.
0 likes
1 reply
jlrdw's avatar

Have you changed all the code to also use username. And standard Auth is looking for one or the other, not both. You may need to override the query by extending a class and have in the query email and username returned.

Just study the current code. But of course don't modify anything in the vendor folder.

Please or to participate in this conversation.