[Bug] 419 PAGE EXPIRED when I try to login through 127.0.0.1:8000/admin/login #1008
-
Bug reportWhat I didI have started Laravel project, created a few migrations, models and seeder, then I installed latest Backpack, I generated CRUDS for all models using the command. What I expected to happenI was expected to have a functional install by default. What happenedWhen opening the admin panel the styling doesn't load properly and I get 419 errors. In the network section I see that the next files get error code 404:
What I've already tried to fix itI have tried:
Is it a bug in the latest version of Backpack?After I run Backpack, Laravel, PHP, DB versionWhen I run PHP VERSION:8.2.10 PHP EXTENSIONS:Core, bcmath, calendar, ctype, date, filter, hash, iconv, json, SPL, pcre, random, readline, Reflection, session, LARAVEL VERSION:11.9.1.0 BACKPACK PACKAGE VERSIONS:backpack/basset: 1.3.4 |
Beta Was this translation helpful? Give feedback.
Replies: 26 comments 6 replies
-
Hello there! Thanks for opening your first issue on this repo! Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that. Backpack communication channels:
Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch. Thank you! -- |
Beta Was this translation helpful? Give feedback.
-
Hello @zanurban If you are using If you are using https also make sure you write it down in app url. Then clean with
In case this didnt work, check permissions:
And take a look in you error logs. Cheers. |
Beta Was this translation helpful? Give feedback.
-
Hello @jcastroa87 I tried using commands
Can I use chmod on Windows. |
Beta Was this translation helpful? Give feedback.
-
Hi. If you running Windows i dont think you can use these linux commands. Did you try
To check if your config is well setting. Let me know if there is some detail in logs. Cheers. |
Beta Was this translation helpful? Give feedback.
-
It says that everything is ok |
Beta Was this translation helpful? Give feedback.
-
If I don't do Initializing basset check .............................................................................. DONE ERROR cURL error 7: Failed to connect to 127.0.0.1 port 8000 after 2024 ms: Connection refused (see https://c |
Beta Was this translation helpful? Give feedback.
-
How did you serve your aplication? Are you using some web server? |
Beta Was this translation helpful? Give feedback.
-
No I am serving it on my machine via |
Beta Was this translation helpful? Give feedback.
-
Ok, and wich URl file are trying to load? per example common.js? Cheers. |
Beta Was this translation helpful? Give feedback.
-
Yes it is trying to load |
Beta Was this translation helpful? Give feedback.
-
Im asking for the URL you write in browser and the full URL of common.js |
Beta Was this translation helpful? Give feedback.
-
Oh sorry, here it is: |
Beta Was this translation helpful? Give feedback.
-
Look normal, didn you set early storage link?
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Could it be CORS policy by any chance? |
Beta Was this translation helpful? Give feedback.
-
CORS is because didnt load common.js |
Beta Was this translation helpful? Give feedback.
-
You didnt update any config con filesystems.php? Can you share your .env and filesystems.php please, delete all the filesystems.php Thanks. |
Beta Was this translation helpful? Give feedback.
-
ENV file: APP_LOCALE=si APP_MAINTENANCE_DRIVER=file BCRYPT_ROUNDS=12 LOG_CHANNEL=stack DB_CONNECTION=pgsql SESSION_DRIVER=database BROADCAST_CONNECTION=log CACHE_STORE=database MEMCACHED_HOST=localhost CACHE_DRIVER=redis REDIS_CLIENT=phpredis MAIL_MAILER=log AWS_ACCESS_KEY_ID= VITE_APP_NAME="${APP_NAME}" BASSET_DEV_MODE=true |
Beta Was this translation helpful? Give feedback.
-
Filestystems.php I only added my own local disk: `<?php return [
];` |
Beta Was this translation helpful? Give feedback.
-
Hey @zanurban thanks for the report. I am here trying to reproduce your issue but I wasn't able until now. I am more convinced that this is an issue with your setup, because in one of your previous messages you said you were able to load the common.js when moved the project to other PC. So I would try to figure out the issue there, and fix it in the other environment. When you say you get 419 (expired/not present token), it's when you access the login page, or when you enter the credentials and try to login ? Let's also do the following test. If you set You may have your project installed on a directory that's not script writable? I usually put my projects in a folder like Let me know if it works. Cheers |
Beta Was this translation helpful? Give feedback.
-
I get 419 when I try to log in.
When I go to 127.0.0.1/admin I get Error 500 |
Beta Was this translation helpful? Give feedback.
-
Maybe SSL isn't properly set up in your Laravel project? Are you getting a green lock icon in the browser? Shouldn't you set the APP_URL to also use HTTPS? |
Beta Was this translation helpful? Give feedback.
-
Hi @zanurban |
Beta Was this translation helpful? Give feedback.
-
Hello @zanurban did you have any chance to check you server setup to handle about this issue? Cheers. |
Beta Was this translation helpful? Give feedback.
-
Hi @zanurban From what I understand, you're either running your web server via the artisan command or through JetBrains Web or PHPStorm? If you read the php page you will notice this sentence at the top
This, to me, would suggest why you are getting a 419 status code. Laravel/Backpack generally seems to need to make more than one request at a time and the 419 status code is a client side error code implying that something (the session) has expired. I would seriously think about installing a local web server, Laragon, WAMP, etc rather than trying to run everything through php's simple webserver. HTH |
Beta Was this translation helpful? Give feedback.
-
Im glad you solve it, thanks @fronbow for your help too. I will close the issue, but please feel free to re-open or create a new one if needed. Cheers. |
Beta Was this translation helpful? Give feedback.
Hi @zanurban
From what I understand, you're either running your web server via the artisan command or through JetBrains Web or PHPStorm?
In which case, they are running PHP's inbuilt web server ( see https://www.php.net/manual/en/features.commandline.webserver.php )
This looks to be less of a Backpack problem and more of a problem with your PHP setup.
For better debugging I would suggest my previous reply about setting up laragon rather than using php's webserver. From my own experience, it's easier to debug a fully formed web server (apache, nginx, etc) than the php builtin as as far as I'm aware the php one is more for testing and debugging.
If you read the php page you will notice this…