@connor11528 lol awesome...sounds like it wasn't anything I thought of...nice find!
Feb 21, 2019
33
Level 19
- In App/Exception/Handler.php
- Use Illuminate\Auth\AuthenticationException;
- In render function add this instead of "return parent::render($request, $exception);"
public function render($request, Exception $exception) {
return $request->expectsJson()
? response()->json(['message' => $exception->getMessage()], 401)
: redirect()->guest(route('login', ['account' => $request->route('account')]));
}
Level 1
This happens to me a lot, it seems that the cookies don't match the file sessions after a deployment. Presumably because when I deploy using docker the memcached sessions are cleared and the cookie is now invalid.
Personally I use a standard form submission and no AJAX so the 419 really threw me off.
I think what I have to do after reading over this thread is to try running php artisan cache:clear because when I make a code change my composer script is not run.
Please or to participate in this conversation.