Nuxt Authentication with Laravel Sanctum

  Рет қаралды 32,367

Codecourse

Codecourse

Күн бұрын

Want more? Explore the library at codecourse.com
A quickstart guide to authenticating in Nuxt with a Laravel API using Sanctum. We’ll use the latest version of nuxt/auth, which includes native support for Sanctum as a provider.
Official site
www.codecourse...
Twitter
/ teamcodecourse

Пікірлер: 55
@SandmanGeek
@SandmanGeek 3 жыл бұрын
Nicely explained Alex. A video on Laravel Sanctum with GraphQL would be a great help as there are not many tutorials/guides, specifically with GraphQL.
@agun21st
@agun21st 3 жыл бұрын
best and easy tutorial for Laravel Sanctum with Nuxt Auth. Salute Sir. easiest explanation.
@oussamavive1
@oussamavive1 2 жыл бұрын
thank you very much Alex! i finally got the 'stateful' meaning and get it working properly!!!
@xLastxTemplarx
@xLastxTemplarx 3 жыл бұрын
Regarding what you said at 7:42 , you still need to add an index.js file inside the store folder, otherwise vuex will not work and you will need to refresh your page after logging in for example in order to see the changes.
@cla1814
@cla1814 2 жыл бұрын
Thank you missed this step. No wonder why login was not working.
@MuhammadKhalilZarpio
@MuhammadKhalilZarpio 3 жыл бұрын
Please make a video on nuxt auth configuration with Laravel passport, reading everywhere since yesterday but not in luck. Thank you 💕
@ColorFR
@ColorFR 3 жыл бұрын
i have this issue: '...CSRF token mismatch..." any idea? i pasted 1 day on this problem
@JesusGil90
@JesusGil90 Жыл бұрын
It would be great if you can continue with Two Factor Authentication 😁
@josuebarros-desenvolvedorw2490
@josuebarros-desenvolvedorw2490 3 жыл бұрын
how can I do a mult-auth??? different authentication for /admin and another for /user??? 2 separate dashboards, manipulating 2 separate user types (not role)
@gurmukhsingh-uh5qo
@gurmukhsingh-uh5qo 2 жыл бұрын
thank you for this video, was facing an issue with env var
@ukandumichael7796
@ukandumichael7796 3 жыл бұрын
had no choice but to subscribe...great video..short and useful
@pablodiazmateus2263
@pablodiazmateus2263 3 жыл бұрын
Hi Alex hope you are doing great. I'm having an issue deploying the Nuxt js + Laravel application. I have 2 index files ... of course I can't have them both ... The nuxtjs makes a index.html with all the app and the Laravel makes a index.php. So the issue is that if I left the nuxtjs one ... I can't access to Laravel Telescope/Horizon, and if I remove the index.html I can't access the Front-end I made with Nuxtjs. Any ideas - videos - recommendations about it ? Thanks in advance for your time !
@Shatic
@Shatic 3 жыл бұрын
Thank you for this tutorial!
@iffar1830
@iffar1830 3 жыл бұрын
Why didn't you get the CORS issue when you requested /login endpoint even if you did not exclude that endpoint in config/cors.php ?
@muhammadfadzilah9394
@muhammadfadzilah9394 3 жыл бұрын
how to solve error with Session store not set on request. I using stateful sanctum
@RamuRamu-eu2sx
@RamuRamu-eu2sx 3 жыл бұрын
You did good tutorial on nuxt.js but registration and Login things makes us so difficult to understand can you add registration part on this
@rodrigoalejandrobravopina3624
@rodrigoalejandrobravopina3624 Жыл бұрын
THX BRO STILL WORKING
@jonice4229
@jonice4229 2 жыл бұрын
can you make a tutorial how to deploy this?
@OreefyOfficial
@OreefyOfficial 3 жыл бұрын
Is it possible? Laravel as backend and NuxtJs as a frontend to host into the same domain.
@r3n736
@r3n736 2 жыл бұрын
of course why not?
@АнтонРевякин
@АнтонРевякин 3 жыл бұрын
But how to register via auth-next???
@КириллБелоусов-ы5е
@КириллБелоусов-ы5е 3 жыл бұрын
in which folder is the admin panel created? in client project or inside laravel project?
@Mahmudulhasan-ts5hm
@Mahmudulhasan-ts5hm 3 жыл бұрын
how to use SPA auth and TOKEN auth both together ?
@Irsatechnologyco
@Irsatechnologyco 3 жыл бұрын
in LoginController Unhandled \Illuminate\Auth\AuthenticationException for throw new AuthorizationException
@chineduchiaju2519
@chineduchiaju2519 2 жыл бұрын
Hey please on deployment, what would be the SESSION_DOMAIN
@ivogacina4740
@ivogacina4740 3 жыл бұрын
you did not provide middleware:['auth'] in nuxt.config , means your routes are not procteded on client side , you can acess any route without being logged in.If you add that , like docs says , than refreshing the page always redirects you to login even if you are already logged in.This is broken lib completely, just look at git issues
@Insidious18
@Insidious18 3 жыл бұрын
Nice! Any idea how I can add Google signin to work with this setup?
@KAZUxVIEW
@KAZUxVIEW 3 жыл бұрын
Thanks a lot !
@siyabdev
@siyabdev 2 жыл бұрын
You're a GEM
@felipefl200
@felipefl200 3 жыл бұрын
Awesome and helpfull
@AhmadZaki95
@AhmadZaki95 2 жыл бұрын
'/user' already return unauthentication !!!!
@alexnewman7853
@alexnewman7853 3 жыл бұрын
i have a problem with CORS on localhost. What to do?
@douglasokonu2653
@douglasokonu2653 3 жыл бұрын
I had the same problem and changed the paths on the config file: cors.php : 'paths' => ['api/*', '/sanctum/*'], then cleared cache with (important!): php artisan config:gache
@ViralTVAbyzer
@ViralTVAbyzer 3 жыл бұрын
great videos
@eslamabdallahabass5662
@eslamabdallahabass5662 2 жыл бұрын
This doesn't work with nuxt3
@JenuelDevTutors
@JenuelDevTutors 3 жыл бұрын
is their a video about registering a new user?
@ezekielwachira1691
@ezekielwachira1691 3 жыл бұрын
I was wondering on that but registering a user does not use nuxt auth with sactum, you have to manually do that, send an API request to a register route in your laravel project but you will encounter CORS issues when doing that, to remove the CORS issues, first you have to make a request to Sanctum CORS then make your register request to the server.
@JenuelDevTutors
@JenuelDevTutors 3 жыл бұрын
@@ezekielwachira1691 oh yeah,, I actually figured it out, I create an API for my register function. Thanks :)
@jorgeluisborges8166
@jorgeluisborges8166 3 жыл бұрын
theme vscode?
@Mahmudulhasan-ts5hm
@Mahmudulhasan-ts5hm 3 жыл бұрын
show to add register in this process?
@ezekielwachira1691
@ezekielwachira1691 3 жыл бұрын
I was wondering on that but registering a user does not use nuxt auth with sactum, you have to manually do that, send an API request to a register route in your laravel project but you will encounter CORS issues when doing that, to remove the CORS issues, first you have to make a request to Sanctum CORS then make your register request to the server.
@ezekielwachira1691
@ezekielwachira1691 3 жыл бұрын
CORS issues happening
@chronyan
@chronyan 3 жыл бұрын
github.com/nuxt-community/proxy-module
@douglasokonu2653
@douglasokonu2653 3 жыл бұрын
I had the same problem and changed the paths on the config file: cors.php : 'paths' => ['api/*', '/sanctum/*'], then cleared cache with (important!): php artisan config:cache laravel doesn't load the cors.php config file edits until you clear the cache hence the cors error
@ezekielwachira1691
@ezekielwachira1691 3 жыл бұрын
@@douglasokonu2653 I solved it using proxy module 🤞
@yonghunchoi8944
@yonghunchoi8944 3 жыл бұрын
great !!!
@benyaminbolhassani3708
@benyaminbolhassani3708 3 жыл бұрын
thanks . can u help me out when i get this error No 'Access-Control-Allow-Origin'
@douglasokonu2653
@douglasokonu2653 3 жыл бұрын
I had the same problem and changed the paths on the config file: cors.php : 'paths' => ['api/*', '/sanctum/*'], then cleared cache with (important!): php artisan config:gache then it worked
@omareliotorrescastillo4808
@omareliotorrescastillo4808 6 ай бұрын
@@douglasokonu2653 this solution does not work
@SohailKhan-tc8uz
@SohailKhan-tc8uz 3 жыл бұрын
Hi bro first comment
@jonahmarsden
@jonahmarsden 2 жыл бұрын
CORS errors everywhere. Tutorial is completely useless now, don't waste your time.
@jaspercaelan4998
@jaspercaelan4998 2 жыл бұрын
Same, doesn't work.
@JesusGil90
@JesusGil90 Жыл бұрын
@masaakiuechi6190
@masaakiuechi6190 Жыл бұрын
If you are having 401 unauthorized error after loggin, fix SANCTUM_STATEFUL_DOMAINS on .env file to " SANCTUM_STATEFUL_DOMAIN". It worked for me...
Laravel SPA Authentication - setup and common mistakes
16:55
What’s Up with Laravel? It’s Everywhere, and Here’s Why!
6:22
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 1,8 МЛН
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 123 МЛН
Nuxt Explained
8:33
Awesome
Рет қаралды 28 М.
Laravel 8 REST API With Sanctum Authentication
54:13
Traversy Media
Рет қаралды 548 М.
Laravel SPA Auth different domains
10:51
cdruc
Рет қаралды 9 М.
Easily Add Authentication With Nuxt 3 + Supabase
14:23
John Komarnicki
Рет қаралды 15 М.
New in Laravel 11: The when() helper
6:52
Codecourse
Рет қаралды 732
Build a shopping cart with Laravel Cashier and Vue
55:07
Andrew Schmelyun
Рет қаралды 48 М.
Laravel Sanctum SPA with Nuxt Client
48:04
Fusi Gabz
Рет қаралды 14 М.
Laravel Websockets and Laravel Echo with Vue
12:45
Codecourse
Рет қаралды 51 М.
Using a Laravel REST API with a NuxtJs App
15:43
Laravel
Рет қаралды 36 М.
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 1,8 МЛН