nuxt js, laravel, token is not provided - laravel

i'm a learning nuxt js and laravel, I have been doing an api with laravel and the front with nuxt js, when i work on localhost everything works fine but when i upload my api to a remote server the error appears on my nuxt app {"error":"Token is no provided"} this only happens when the api is on the remote server
my nuxt config looks like this
everything works fine on localhost, but not on the remote server, and on the internet I hardly find any information about it, thanks
in my laravel authController i have this

Related

Laravel/VueJs Sanctum CSRF mismatch when deployed

Can't seem to work out why I keep getting CSRF token mismatch with my deployed app. On local using valet it's working fine.
The backend and frontend are on 2 different servers but they share the same subdomain so surely this should work?
My local .env contains the following:
SESSION_DOMAIN=.rss.test
SANCTUM_STATEFUL_DOMAINS=front.rss.test:3001
My live .env contains the following:
SESSION_DOMAIN=.dally.tech
SANCTUM_STATEFUL_DOMAINS=rss.dally.tech
The API is sat on the domain:
rss-api.dally.tech
Really confused why this isn't working.

Django djoser 401/400 for creating users

I deployed a nuxt app to heroku and when I am running it locally, the app is working fine. On the other hand in production the login / register is not working it is always says 400 bad request (there is no explaination why it is a bad request) or 401 unauthorized.
When I am running the up locally, I am pointing to the backend api and it is working fine.
But when it is run in heroku, I get the errors (400 and sometimes 401), oddly it's worked like there random times from different devices but when I logged out and retry create a user errors.
I did not change the code.
I am not sure the problem is with my code or heroku or maybe Pythonanywhere which I am using to host my backend.
It is my first time deploy python DRF as backend and nuxt as front.
My backend is in python DRF.
My front-end nuxt repo nuxt repo
My DRF code backend repo.
In the nuxt app you can see register component with function onSubmit which should register the user and then log him in.
And DRF there is an app name users_auth which has the user model as CustomUser and the Todo model.
nuxt.config.js points to the same place locally and in production.

not sending auth request in laravel echo server cli on server

It works fine on local but does not work on server.
my local image
On the server image
I use Laravel 5.8 and vuejs
is domain https
My problem was solved, the app.js file on the host was not Compiled correctly, and I uploaded it locally

connect nuxtJS with laravel

I'm new in LARAVEL and nuxtJS, So sorry for my question if it somehow silly. I'm working on a project that developed by anthor one. There is no implementation. The client gave me two folder one for frontend developed by nuxtJS and one for backend developed by laravel.
I tried to run a project. But I fails. Could anyone to help me in that. I installed npm for nuxtJS and composer for laravel.
please ask me for anypart of a code which can help. And I'll post it
Thak you.
Assuming Laravel is intended as an API, treat each folder as a separate app. Startup your nuxt application like any other nuxt application. Startup your Laravel application like any other Laravel application. Then using axios or some other fetch library inside your nuxt app, make requests to your Laravel url.
Say you have nuxt running on http://localhost:3000 and you have Laravel running on https://localhost:8000. Inside your nuxt app, where you need to connect to Larvel, you can use axios to get access to your data from Laravel (e.g. axios.get('http://localhost:8000/api/some/resource'))
The docs on asyncData has a good example of making API calls https://nuxtjs.org/guide/async-data

Using Laravel and Ionic together with Nginx routes

I have an Ionic 3 web app where I'm using Laravel for both the API and the back-end manager with Nova. Ideally, I'd like my setup to be:
Server 1: example.com serving only my static Ionic App
Server 2: api.example.com serving my Laravel API
Server 2: example.com/admin serving my Laravel backend with Nova
This is easy with Laravel forge, except that I want api.example.com and example.com/admin to be powered by the same application. Right now it looks like I would need my code to live as two separate applications, one for api. and one for /admin.
It makes sense that there would be a way to configure Nginx to point both to the same place, but how, and which one, and where?
I solved this with a redirect from /admin to the appropriate destination. You can either do this in nginx or in Ionic.

Resources