I have just started a new laravel project, and the problem I have is that after making the php artisan make:auth
command the login, the registration and the user recovery form are generated, all perfect.
I configure the mail and everything works correctly, until, after going to the link that sends me the email when I try to recover the password, the form to reset the password is opened correctly and the first error that came out was:
" The password does not match"
And obviously it should work without more, since it is autogenerated by laravel, I say, but make some changes in the view, and I no longer throw the error, now simply turn the page and throw me the following error:
TokenMismatchException in compiled.php line 3227:
Here is the code of the view:
<body data-open="hover" data-menu="horizontal-menu" data-col="1-column" class="horizontal-layout horizontal-menu 1-column blank-page blank-page">
<!-- ////////////////////////////////////////////////////////////////////////////-->
<div class="app-content container center-layout mt-2">
<div class="content-wrapper">
<div class="content-header row">
</div>
<div class="content-body"><section class="flexbox-container">
<div class="col-md-4 offset-md-4 col-xs-10 offset-xs-1 box-shadow-2 p-0">
<div class="card border-grey border-lighten-3 px-2 py-2 m-0">
<div class="card-header no-border pb-0">
<div class="card-title text-xs-center">
<img id="branding-logo" src="../../images/globalretail.png" alt="branding logo">
</div>
<h6 class="card-subtitle line-on-side text-muted text-xs-center font-small-3 pt-2">
<span>Introduce tu nueva contraseña</span>
</h6>
</div>
<div class="card-body collapse in">
<div class="card-block">
<form class="form-horizontal form-simple" action="{{ url('/password/reset') }}" method ="post" >
<!-- {{csrf_field()}}-->
<input type="hidden" name="_token" value="{{$token}}">
<!-- <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">-->
<fieldset class="form-group position-relative has-icon-left">
<input type="email" class="form-control form-control-lg input-lg" name ="email" id="email" placeholder="Introduzca su email" value="{{old('email')}}">
<div class="form-control-position"><i class="icon-head"></i></div>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</fieldset>
<fieldset class="form-group position-relative has-icon-left">
<input type="password" class="form-control form-control-lg input-lg" name="password" id="password" placeholder="Contraseña nueva" required confirmed>
<div class="form-control-position"><i class="icon-key3"></i></div>
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</fieldset>
<fieldset class="form-group position-relative has-icon-left">
<input type="password" class="form-control form-control-lg input-lg" name="password_confirmation" id="password_confirmation" placeholder="Repita contraseña" >
<div class="form-control-position"><i class="icon-key3"></i></div>
@if ($errors->has('password_confirmation'))
<span class="help-block">
<strong>{{ $errors->first('password_confirmation') }}</strong>
</span>
@endif
</fieldset>
<button type="submit" class="btn btn-primary btn-lg btn-block"><i class="icon-unlock2"></i> Restablecer contraseña</button>
@include('errors.flash-message')
</form>
</div>
</div>
</div>
</div>
</section>
Do I have to make any configuration?
EDITO
Email route:
The requested URL / password / reset / 4625b4fb523847321308e02fba91ea5bddfa7ca3f2a0d7db583b39117af0ae25 was not found on this server.
Routes:
Route::group(['middleware' => 'guest'], function () {
Route::get('login', 'Auth\AuthController@getLogin');
Route::post('login', ['as' =>'login', 'uses' => 'Auth\AuthController@postLogin']);
//Route::get('password-request', 'Auth\PasswordController@getPasswordView');
Route::get('password/email','Auth\PasswordController@getEmail');
Route::post('password/emails','Auth\PasswordController@postEmail');
Route::get('password/reset/{token}','Auth\PasswordController@getReset');
Route::post('password/reset','Auth\PasswordController@postReset');
I really believe that everything is well configured and I do not know why the recovery method does not work.
Greetings and thanks in advance.
Edit: Testing the tokens and so, I managed to get the correct token to accept it, my problem now comes with that laravel, I do not take the confirmation of the password and throws my warning that they do not match the passwords, I tried to modify the method that is responsible for making the rules but even so, I can not advance from that point.
protected function getResetValidationRules()
{
return [
'token' => 'required',
'email' => 'required|email',
'password' => 'required|alpha_num|between:4,8',
];
}
But let's go that no case does.