0
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 out:
public function logout(){
Auth::logout();
Session::flush();
return view('autenticacao.login');
}
When I try to re-log in, I get error:
Tokenmismatchexception in Verifycsrftoken.php line 68
But if I refresh the page works normally, but it’s annoying for the user to have to refresh the page whenever they want to log in again.
What can it be?
You need to give a
redirect
in this case, that is, does not load anything in that part, because when logging out and wipes the data ofsession
.– novic
@Virgilionovic did not understand well. Because I can not log out since my intention is precisely to clean the data?
– Italo Rodrigo
@Virgilionovic, I managed to solve yes, by doing a search for redirect and logout, thank you
– Italo Rodrigo
is that in this specific case you had the entire session cleaned and at the same time loaded a
view
and this does not generate thecsrf token
, so I said I need to give aredirect
to re-generate the data ...– novic
@Virgilionovic got it. solved my problem
– Italo Rodrigo