Closed gabrielfigueroa closed 4 years ago
You'll have to configure in your .env SANCTUM_STATEFUL_DOMAINS=http://admin.digihometour.com
@gandesc we need to update the install steps regarding this.
Please prioritize it as much as you can.
This entry in the .env goes in the main folder or in the client folder?
It's related to Laravel Sanctum so it goes in the root .env
In dev mode add localhost, domain.test
I did what you suggested and still have the same error. When I try to login to the enso demo with incorrect credentials I get an error. When I do it in my installation it doesn't return the same error, instead it does nothing. I launched the client and it said
App running at:
While the .env has API_URL=http://admin.digihometour.com:8000/
I installed all dependencies and requirements and got no errors and I can't find an error in the laravel.log.
If you inspect in the console => network => api call you will see that you are missing the device_name
.
This is happening because you did nou configure correctly sanctum's stateful domains.
Hi Gabriel,
In my notes below, replace enso
with your project name
First, in your project root .env
file, make sure you have:
...
APP_URL=http://admin.enso.test
...
SANCTUM_STATEFUL_DOMAINS=localhost,127.0.0.1,127.0.0.1:8000,localhost:8080,::1,enso.test,admin.enso.test
Second, in your client/ .env
file, make sure you have:
API_URL=http://enso.test:80/
client/yarn build
, then you should be able to log in from admin.enso.test
client/yarn serve
, then you shoould be able to log in from http://localhost:8080
I installed all dependencies and requirements and got no errors and I can't find an error in the laravel.log.
The error would have been in your browser's console (network).
Do let us know if you got it working.
I'm followed this instructions and after running yarn serve in the client/ directory now I get the following error:
$ vue-cli-service serve INFO Starting development server... 10% building 2/2 modules 0 activeevents.js:174 throw er; // Unhandled 'error' event ^
Error: ENOSPC: System limit for number of file watchers reached, watch '/var/www/html/back-end/client'
at FSWatcher.start (internal/fs/watchers.js:165:26)
at Object.watch (fs.js:1258:11)
at createFsWatchInstance (/var/www/html/back-end/client/node_modules/chokidar/lib/nodefs-handler.js:38:15)
at setFsWatchListener (/var/www/html/back-end/client/node_modules/chokidar/lib/nodefs-handler.js:81:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/var/www/html/back-end/client/node_modules/chokidar/lib/nodefs-handler.js:233:14)
at FSWatcher.NodeFsHandler._handleDir (/var/www/html/back-end/client/node_modules/chokidar/lib/nodefs-handler.js:429:19)
at FSWatcher.
I am rebooting the system to see if that system limit of number of file watchers is reset.
Followed the instructions to the letter and when I inspect after attempting to login I get the following error:
POST http://admin.digihometour.com/api/login 422 (Unprocessable Entity)
What is the error message in the server response? You can inspect it in the browser console, on the network tab.
{message: "The given data was invalid.", errors: {device_name: ["The device name field is required."]}} errors: {device_name: ["The device name field is required."]} message: "The given data was invalid.
Can't find anything regarding device_name in the installation instructions.
The error is still related to SANCTUM_STATEFUL_DOMAINS and/or a misconfiguration.
So, to confirm, you have?
APP_URL=http://admin.digihometour.com
SANCTUM_STATEFUL_DOMAINS=digihometour.com,admin.digihometour.com
Keep in mind that if you're caching the configs on a live server, you may need to clear the cache / do a redeploy /etc for the new values to be considered.
Lastly, you may try the app on your local dev computer, to ensure it's not related to how the live server is setup, re domains, sub domains or something else.
I had it with .test instead of .com since in the instructions provided here it said to replace enso with homedigitour but still kept the .test domain. I am just testing the app on a brand new vps so it should not be an issue as I am installing exactly the services with the corresponding versions needed. I am not sure how device_name is related to SANCTUM_STATEFUL_DOMAINS but I will update the .env files with the correct domain (which I had originally) and run php artisan to clear the cache and try once more.
it worked now. thank you very much!
I am attempting to login using the admin@laravel-enso.com and password credentials. I seeded my tables and I see the entry on the users table for admin@laravel-enso.com.
Nothing happens after I hit Login.
My URL for testing Enzo SPA is: http://admin.digihometour.com/login