I found the solution.
My error was on the recovery of the csrf token which was not good.
I would retrieve the long string contained in the XSRF-TOKEN cookie, while I had to receive the token from my backend. These 2 strings are strictly different, for some reason that I don't know yet.
I just needed to send the csrf token to my front-end with the csrf_token() method
return Inertia::render('Dashboard', [
'publications' => $publications,
'users' => $users,
'csrf_token' => csrf_token()
]);
I didn't need to do the form manually either
Finally, I was able to grab the token as a prop and include it in my post request like this:
this.$inertia.post('/logout', {
_token: this.$props.csrf_token
})
This link helped me
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…