My login form works correctly:
<form action="{{route('autenticacao.logar')}}" method="post">
{{csrf_field()}}
<input type="text" name="cpf" class="form-control" placeholder="CPF" style="border-radius:10px; border-color:blue;" />
<br/>
<input type="password" name="senha" class="form-control" placeholder="senha" style="border-radius:10px; border-color:blue;" />
<br/>
<input type="submit" class="btn btn-primary btn-block btn-flat" value="Entrar" />
</form>
However, if I log off:
public function logout(){
Auth::logout();
Session::flush();
return view('autenticacao.login');
}
When I try to re-login, I get an error:
TokenMismatchException in VerifyCsrfToken.php line 68
But if I refresh the page it works normally, however it's annoying for the user to have to refresh the page whenever he wants to sign in again.
What can it be?