0

Hi every one Am using Laravel nova 4 on the login am having the following error when i fill and submit the login form

exception: "Symfony\\Component\\HttpKernel\\Exception\\HttpException"
file: "F:\\MAG\\Projet Dev MAG\\GOHZE Project\\Echomoov\\Src\\Account\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Exceptions\\Handler.php"
line: 379
message: "CSRF token mismatch."
```|
Any idea on how to solve this issue 
3
  • Do you have a CSRF tag on your login form? Usually added with @csrf or csrf_token() Commented Jun 20, 2022 at 16:43
  • Am using laravel nova by default it have it Commented Jun 20, 2022 at 16:53
  • @aynber any idea Commented Jun 20, 2022 at 17:21

1 Answer 1

-1

If you use the application on development environment, you can modify this file

app/http/Middleware/VerifyCsrfToken.php

Add/modify following line with your application url or '*/*'

protected $except = [
        //
        'http://localapp.test/*',
        '*/*'
        
    ];

Hope this can help you solve the problem

Sign up to request clarification or add additional context in comments.

1 Comment

Exempting / from CSRF checking is ⚠️ terrible from security perspective. Even "just nova paths" would be terrible idea since Nova is usually used for admin panels, i.e. its endpoints expose CRUD for the whole DB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.