Laravel 10: forgot yourpassword links jumps back to login form

I am using the Laravel auth package in a Laravel 10 project. The Forgot Password link used to work a few weeks ago. I don’t know what changed, but when I click the Forgot Your Password link, it displays the Password Reset form for a moment and then redisplays the Login form. The routes:list does display routes for password reset.

 GET|HEAD   password/confirm .................. password.confirm › Auth\ConfirmPasswordController@showConfirmForm
 POST       password/confirm ...................Auth\ConfirmPasswordController@confirm
 POST       password/email .............. password.email › Auth\ForgotPasswordController@sendResetLinkEmail
 GET|HEAD   password/reset ................. password.request › Auth\ForgotPasswordController@showLinkRequestForm
 POST       password/reset ........................ password.update › Auth\ResetPasswordController@reset

Any suggestion on how to fix this issue?

  • so you have some type of javascript running on that page that displays the password reset form?

    – 

  • Well, check your Git log and see what changed since it last worked.

    – 

  • @ceejayoz: I have been updating code on daily basis. If I can I have idea, which file is causing the issue, I can look at git.

    – 

  • @lagbox: I am using the default forms generated by the auth package — I have not added any javascript code to the login or reset password forms

    – 

  • by what auth package? and how did you install it?

    – 

The layouts file (@extends(‘layouts.app’)) in resources/views/auth/passwords/email.blade.php was causing the issue as in this file, I added few Javsscript files for JQuery and others, which I need for my application. To fix the issue, I created another layouts file for use with email.blade.php, as given.

<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>{{ config('app.name', 'Thread') }}</title>

    @vite(['resources/sass/app.scss'])
</head>
<body>
    <div>
        @yield('content')
    </div>
</body>
</html>

Leave a Comment