set chmod 770 to /storage/framework/sessions
Sep 12, 2017
5
Level 1
Error in Laravel 5.4 "TokenMismatchException in VerifyCsrfToken.php" I'm using {!! csrf_field() !!}
I'm with a big error, In local all ok, but in web server(production) it's error "TokenMismatchException in VerifyCsrfToken.php". My CODE:
FORM
<form role="form" method="post" action="{{ route('front.login') }}" class="login-form">
{!! csrf_field() !!}
<div class="form-group @if ($errors->has('email')) has-error @endif">
<label class="sr-only" for="form-username">Email</label>
<input type="email" name="email" placeholder="Email..." class="form-username form-control @if($errors->has('email')) input-error @endif" id="form-username" value="{{ old('email') }}">
@if ($errors->has('email')) <p class="help-block"> {{ $errors->first('email') }} </p></div> @endif
</div>
<div class="form-group @if ($errors->has('password')) has-error @endif">
<label class="sr-only" for="form-password">Senha</label>
<input type="password" name="password" placeholder="Senha..." class="form-password form-control @if($errors->has('password')) input-error @endif" id="form-password" value="{{ old('password') }}">
@if ($errors->has('password')) <p class="help-block"> {{ $errors->first('password') }} </p> @endif
</div>
<div class="form-group text-center">
<button type="submit" class="btn btn-dark-blue text-center">Entrar no Sistema</button>
</div>
</form>
CONTROLLER
$this->validate($request,[
'email' => 'required',
'password' => 'required'
]);
$data = [
'email' => $request->input("email"),
'password' => $request->input("password")
];
if(Auth::attempt($data)){
return redirect()->route('front.home');
}
Please or to participate in this conversation.