How one would avoid calling /user when the user is not logged in? It returns 401 unauthenticated but the call is being made for no reason... Cookie is always set even after logging out...
3 года назад
I really like that you did this, I want to try some new front end to replace livewire.
I read your article about external front end with laravel backend a few months back and it guided me in building a desktop app that connects to laravel api via session, the cookies are sent from backend to front end which is used to persist the user session. I also got a deep dive to Laravel authentication and implemented a login auth from the desktop app that authenticates using the database from backend, which is kinda confusing to setup at first. Anyway gotta try nextjs soon
I find this tutorial very helpful, however - in a "real" setup, you would probably utilize a HOC, in order to render the "loading" state, for e.g. pages with an auth middleware. Or authenticate server side, to prevent flickering. Do you have any plans for tutorials for either a HOC, or Authentication on the server? Cheers.
I use this approach in a template, and it doesn't work. The useAuth method only runs once so the page is stuck at loading. I also did this in a clean project and it worked fine, because it runs multiple times. Anyone knows how why useAuth only runs once for my case?
I woke up pondering this approach and this tutorial was exactly the introduction I needed to assess feasibility, thank you so much! I'm curious about production deployment options. The Laravel blog has an article regarding Forge, but if I were to use Laravel Vapor for the backend, would I have to use Vercel (or similar, independently from Vapor) to deploy the NextJs app?
I get a "unable to verify the first certificate" error from my nextjs app if I try to use SSG or SSR. However, if I use CSR it works fine. How did you get yours to work with your valet provided certificates?
is it possible to use Laravel as headless CMS to bypass CORS for same origin issue to distribute the API on tenant mode or different domain distribution ?
Thank you, can you explain bit more about hosting backend and frontend app or make a separate tutorial for that?
perfect timing man...I needed it.
Nice :)
Well done. But to be “fair” 😀, kindly do one with NuxtJS. Pleeease!
I might :D
I think next js is better one haha
Okk Next
Mohamed you have no idea how much this helped me
Thank you 😭😁
Glad it did 🙂
How one would avoid calling /user when the user is not logged in? It returns 401 unauthenticated but the call is being made for no reason... Cookie is always set even after logging out...
I really like that you did this, I want to try some new front end to replace livewire.
y u want to replace livewire?
@@mansourmansour5841 is super slow with big datasets, this is not elixir phoenix
Why are is allowed_origins set to all? Surely this should be set to the domain? This could be a security risk
One part missing in axios instance is add
withXSRFToken: true
This caused lot of headache
I read your article about external front end with laravel backend a few months back and it guided me in building a desktop app that connects to laravel api via session, the cookies are sent from backend to front end which is used to persist the user session. I also got a deep dive to Laravel authentication and implemented a login auth from the desktop app that authenticates using the database from backend, which is kinda confusing to setup at first. Anyway gotta try nextjs soon
Nice! Glad you find my content useful :)
which article. can you provide the link?
no dummy data anymore, very nice
Great Tutorial, but can you explain in detail nuxt js and in to regard job in laravel
Great Tutorial, on a side note, I really like you PhpStorm settings. Which theme do you use?
Looks like Night owl
It's called Night Owl
Hello, why user variable is undefined? I've got the details for logged on user, but it can't assign to user variable
Hello Bro! Should I need to run Laravel and NextJs in different ports? Or Laravel will manage internally ports?
Nice tutorial, btw which theme and fonts do you use?
I find this tutorial very helpful, however - in a "real" setup, you would probably utilize a HOC, in order to render the "loading" state, for e.g. pages with an auth middleware.
Or authenticate server side, to prevent flickering.
Do you have any plans for tutorials for either a HOC, or Authentication on the server?
Cheers.
What is hoc
@@piusijachi2763 higher order component
so where the token store it? as encrypt by nextjs to be cookie or store to local storage?
I use this approach in a template, and it doesn't work. The useAuth method only runs once so the page is stuck at loading. I also did this in a clean project and it worked fine, because it runs multiple times. Anyone knows how why useAuth only runs once for my case?
Respect from Pakistan 🇵🇰
Hot topic much needed
how to return these headers using cors config
Access-Control-Allow-Headers
Access-Control-Allow-Methods
Not about Next, but about react: how come expressions like {errors.lenght && ..some.jsx...} evaluate in jsx being returned, instead of a Boolean?
You do the same fetching using nuxt js. Thank you!
I woke up pondering this approach and this tutorial was exactly the introduction I needed to assess feasibility, thank you so much! I'm curious about production deployment options. The Laravel blog has an article regarding Forge, but if I were to use Laravel Vapor for the backend, would I have to use Vercel (or similar, independently from Vapor) to deploy the NextJs app?
Using Vercel or Netlify for hosting the NextJS app is the most common approach yes.
I get a "unable to verify the first certificate" error from my nextjs app if I try to use SSG or SSR. However, if I use CSR it works fine. How did you get yours to work with your valet provided certificates?
is it possible to use Laravel as headless CMS to bypass CORS for same origin issue to distribute the API on tenant mode or different domain distribution ?
Thanks for sharing great informtion
Great video!
What happen if authenticated user try to access register page?
thank u for this turorial, please any solve problem user unauthenticated in console log , sorry for my english 😀
May i know any reason why you favor react over vue ?
My personal favorite is actually Vue with the options API. But I'm open to trying different tools and technologies all the time :)
This is great stuff. Any suggestions how to deploy this on a LAMP server?
Thanks
You're welcome :)
YOOOOOOOOOOOOOOOOOO