No video

Next.js Authentication Firebase - Sign in with Google

  Рет қаралды 40,713

Code Commerce

Code Commerce

Күн бұрын

Next JS 13 Authentication using Firebase - Sign in with Google
Github Repo:
github.com/fir...
ZeroTo Mastery:
Master React JS Course - bit.ly/Learn-R...
Complete Web Developer in 2023 - bit.ly/Complet...
💻 Solve EDABIT coding challenges - BEGINNER! 💻
bit.ly/Code-Ch...
🔥 Connect with me on IG 🔥
/ fireclint
☕ Support the channel ☕
www.buymeacoff...
🔥 My Coding Equipment 🔥
Logitech MX Wireless Keyboard - amzn.to/3xKPFiN
Logitech MX Master 2S Wireless Mouse - amzn.to/3O5WmRD
SAMSUNG 49-Inch Gaming Monitor - amzn.to/3mvUy8M
Shure MV7 USB Podcast Microphone - amzn.to/3O00nqG
Mic Boom Arm - amzn.to/3NHn6YU
Monitor Desk Light Bar - amzn.to/3xzKlyj

Пікірлер: 92
@criteria6972
@criteria6972 Жыл бұрын
But what would be the point of using the app directory if we are wrapping the entire project in a "use client"
@storyPlus12
@storyPlus12 Жыл бұрын
This dude is completely new to next JS so just take it easy man 😅
@LacChinh
@LacChinh 10 ай бұрын
😂😂😂
@julianrosenberger1793
@julianrosenberger1793 9 ай бұрын
how to do it better?
@josephakpu3340
@josephakpu3340 9 ай бұрын
Create a provider component, which will have the 'use client' directive, then wrap your rootlayout with the provider
@user-eb1oh9ne8f
@user-eb1oh9ne8f 9 ай бұрын
How to make next js useless in one line 😂
@wemakegeeks9148
@wemakegeeks9148 9 ай бұрын
The tutorial is good but what is the use of using NextJs when we are rendering the whole app on the client side.
@adeemmmm
@adeemmmm 18 күн бұрын
That doesn't happen tbh but i got the idea, wrapping the whole app will not result into it being a whole client component
@Trendytrends3000
@Trendytrends3000 8 ай бұрын
Tuto is nice, but putting the 'use client" on the layout is making all the NextJS App client side and we lose the biggest advantage of NextJS which is the server-side rendering
@altertopias
@altertopias 7 ай бұрын
yeah i was wondering about this as well, do you know if there's another way to do it?
@devadeelahmad
@devadeelahmad 7 ай бұрын
@@altertopias Put "use client" in individual components where you are using hooks etc. Then import them in parent, there will be no issue then.
@ripper1117
@ripper1117 10 ай бұрын
By putting 'use client' in the root layout, you are making every child component (your entire project) client components. This makes using the App Router redundant because none of your components will be rendered on the server.
@julianrosenberger1793
@julianrosenberger1793 9 ай бұрын
how to do it better?
@sgnlx_ai
@sgnlx_ai 9 ай бұрын
@@julianrosenberger1793 Move the 'use client' to the top of AuthContext.js
@b2c_org_bd
@b2c_org_bd 9 ай бұрын
did you find any solution? plz mention if you get the perfect solution
@ripper1117
@ripper1117 9 ай бұрын
​@@b2c_org_bdI am also new to NextJS and React, so unfortunately I do not know whether the solution I have found is best practice or not. It may be helpful for you to know that NextAuth is not a platform that provides authentication like Firebase Authentication, but it is a solution that is designed to support any oAuth services including Firebase Authentication. If you are committed to using NextJS, don't be afraid to spend the time to research and understand NextAuth, because it is the OOTB/best practice/recommended solution for implementing auth services like Firebase Authentication.
@sikandarchishty
@sikandarchishty 9 ай бұрын
make group layouts. Let's say your we're in your app directory. Put everything in (auth) folder, (auth) is a group, this won't be part of url. then make a layout.js file in (auth) control everthing from there. (auth)->login, (auth)->dashboard, here login and dashboard are route folders
@BrandonFunk
@BrandonFunk Жыл бұрын
awesome video! i finished the dashboard tut, then this, and now im gonna combine them together, can't wait to do more.
@codecommerce
@codecommerce Жыл бұрын
That's awesome man!
@mohsinalshammari9776
@mohsinalshammari9776 11 ай бұрын
Thank you so much, you helped me build the entire auth functionality for my app. It is the first time I do it.
@anuragdixit3147
@anuragdixit3147 10 ай бұрын
thank you bhai tu hi hai asli coder tu ni hota toh aaj kuch ho ni pata
@Prakash-lq3zh
@Prakash-lq3zh Жыл бұрын
I have been waiting for your video for long time bro.
@codecommerce
@codecommerce Жыл бұрын
Thank you so much dude!
@philipjobran2716
@philipjobran2716 Жыл бұрын
Bruh this just saved my ass, I was really desperate for this specific tutorial .. thx man much appreciated !! ❤
@codecommerce
@codecommerce Жыл бұрын
Happy to help sir!
@kikevanegazz325
@kikevanegazz325 12 күн бұрын
Thanks for taking the time to share this content. However, I must agree with most people in the comment section. Using Next js with firebase on client side only is pointless as it is serverside auth what most people are looking for when typing "Next js auth with firebase".
@niteshprajapat7918
@niteshprajapat7918 Жыл бұрын
Love to see you after long time 🔥⚡
@moizlokhandwala3262
@moizlokhandwala3262 Жыл бұрын
Loved your tutorial man🥰🥰. Please create a video on roles and permissions using nextJs and firebase. Much needed to learn
@jordanmills4945
@jordanmills4945 Жыл бұрын
Great vid but being able to hear the gulping was driving me crazy maybe add a noise gate or noise suppression thanks! 😄
@codecommerce
@codecommerce Жыл бұрын
Sorry Jordan! That should be fixed now. 👍
@camstuart
@camstuart 7 ай бұрын
Well done with this, really helped me.
@codecommerce
@codecommerce 7 ай бұрын
glad to help!
@neoTriny
@neoTriny 2 ай бұрын
Pretty solid, no sh#t. Go ahead !!!🎉
@BerwinSingh
@BerwinSingh 7 ай бұрын
Thanks man for this video. Really helped me in figuring out what I was doing wrong.
@proflead
@proflead 17 күн бұрын
Nice one!
@AntonioGutoCarioca
@AntonioGutoCarioca 8 ай бұрын
Best guides I have found so far. very knowlegeable.
@FSDevOps
@FSDevOps 8 ай бұрын
Love you man!!! Thanks for introduce me to the coding world :)
@jack-ec3he
@jack-ec3he Жыл бұрын
is there a way have a protected route in server side ?
@lilz3bra
@lilz3bra Жыл бұрын
That rafce trick you just casually mention, man does that save time!
@BrandonFunk
@BrandonFunk Жыл бұрын
i love it too! its definitely helpful to spend a little time learning VScode keyboard shortcuts and extensions that fill in for you, it speeds things up so much.
@codecommerce
@codecommerce Жыл бұрын
Love using shortcuts - I'd be lost without them! haha
@matiasosoriofutbol
@matiasosoriofutbol 2 ай бұрын
Hi, thank you, great explanation. It works locally, but I´m getting this error en deploying to Firebase or Vercel: ./app/admon/page.jsx 8:35 Error: React Hook "useState" is called in function "page" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use". react-hooks/rules-of-hooks 11:5 Error: React Hook "useEffect" is called in function "page" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use". react-hooks/rules-of-hooks
@Glebtc
@Glebtc 10 ай бұрын
Is anybody else receiving UserAuth() is not a function error?
@Roman_Milyan
@Roman_Milyan 5 ай бұрын
ye , same, have you fixed this?
@arnav7997
@arnav7997 Жыл бұрын
When I added use client in layout.js it showed me this error You are attempting to export "metadata" from a component marked with "use client", which is disallowed. Either remove the export, or the "use client" directive, How can I fix this.
@jawnho9653
@jawnho9653 11 ай бұрын
I got this too
@joeljoel1236
@joeljoel1236 Жыл бұрын
sir im learning soo much from you, i'll forever be grateful
@codecommerce
@codecommerce Жыл бұрын
Thanks man!
@satyanarayandalei-rz2kw
@satyanarayandalei-rz2kw Жыл бұрын
Really wonderful! Loved it. Thank you so much for sharing you knowledge!
@neelnarwadkar5921
@neelnarwadkar5921 4 ай бұрын
can you also show how to refresh access_token before api call?
@snc0lt
@snc0lt 11 ай бұрын
i get this err when trying this >> "Error: Element type is invalid. Received a promise that resolves to: [object Promise]. Lazy element type must resolve to a class or function." seems like it doesn;t like the useEffect inside a context??
@user-ot2tg2bq1g
@user-ot2tg2bq1g 9 ай бұрын
The tutorial was amazing🥰. Can you please do apple authentication tutorial with next auth and firebase, it would be so helpful.
@pcastillogarita
@pcastillogarita Жыл бұрын
Hi there, can you build a spotify/netflix whatever you want clone connecting it with an API? I really want to learn how you do that
@user-kg3eu1jq2r
@user-kg3eu1jq2r 3 күн бұрын
Thanks a lot
@VolkhvYT
@VolkhvYT Жыл бұрын
Awesome video, exactly what I was looking for. Thank you
@maksimtalko6145
@maksimtalko6145 5 ай бұрын
Thank you so much! You are the best!
@abdikadirQulle
@abdikadirQulle Жыл бұрын
pro i want to use this code react js can i use it
@wilsonbalderrama
@wilsonbalderrama 10 ай бұрын
amazing explanation, thank you for this example
@gaurangshroff
@gaurangshroff 7 ай бұрын
I have made a service to make the api calls. How can i pass the token in each api calls from this AuthContext? Also the token gets expired after a period of time. how can I handle this?
@MrSand7ip
@MrSand7ip 6 ай бұрын
How would I combine the expense tracker app you developed in the previous video with this authentication?
@aviv6jx
@aviv6jx Жыл бұрын
Thank you, amazing video and work amazing. there is another way instead using "use client" in next.js ?
@_thewatcher27
@_thewatcher27 6 ай бұрын
Do we need to hide the firebase config on an env file?
@samyakshah9119
@samyakshah9119 Жыл бұрын
Great video!
@FullstackDeveloper-tf7zy
@FullstackDeveloper-tf7zy 3 ай бұрын
thanks dear
@christianmiguez1379
@christianmiguez1379 10 ай бұрын
Thanks for make and share it. love it I need to implement email/password too, there is a way to enable this second method?
@user-sd3xl4kv1m
@user-sd3xl4kv1m 8 ай бұрын
Thank you man
@netcastings
@netcastings Жыл бұрын
thanks for the video, it really helped. But when calling googleSignIn -> the list of emails isnt shown, it logs me in with main google email right away, but does not give a possibility to "Choose from.." other emails that i have. have u experienced this?
@stefandimitrov6093
@stefandimitrov6093 8 ай бұрын
Have you used multiple google accounts in the browser? If it's just one, it doesn't prompt you to choose.
@ayanghosh7635
@ayanghosh7635 Жыл бұрын
Hey clint!! that's an amazing tutorial right there.. was really helpful!! but i was struggling with the coop policy blocking out the pop up window which happened for you as well, then i used the signInWithRedirect method to tackle it.. but do you have any solution regarding this? and another problem that it was showing this site might be harmful and it told me to register this app to google cloud console.. can you suggest me something regarding that issue too?
@codecommerce
@codecommerce Жыл бұрын
Perhaps it made too many calls. CORS can be tricky and certainly a pain!
@riyadkarim5808
@riyadkarim5808 10 ай бұрын
Thank you very much
@alangutierrez6963
@alangutierrez6963 Жыл бұрын
i keep getting this error "Unhandled Runtime Error TypeError: (0 , firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp) is not a function" i am not sure how to fix it I have looked all over the web and nothing seems to help me fix it it says it has to do something with this line "> 19 | const app = initializeApp(firebaseConfig);" someone please help 🙏
@BrandonFunk
@BrandonFunk Жыл бұрын
i had this problem too, but i don't know how i fixed it, i just kept going through each page and making sure the code was all correct and it started working lol. I think i moved the imports to the top and it worked but i don't see why because the rest is just comments but for whatever reason it worked. try looking over your code a few times
@david_law
@david_law 8 ай бұрын
I had the same error but I realized it may have to do with the fact that I put "use server" directive in the firebase.js file. It worked after I removed the directive.
@angedegmonjarbas4203
@angedegmonjarbas4203 10 ай бұрын
youre using context auth not next auth
@avigdev
@avigdev 11 ай бұрын
good but all the app is now client app. for this i can use react not need nextjs
@niranjan6631
@niranjan6631 Жыл бұрын
Please make a tutorial on apple vision pro website clone !!!!
@codecommerce
@codecommerce Жыл бұрын
Ah yah that is a clean looking website. That would be fun, but it would definitely take a bit of time to complete.
@vizunaldth
@vizunaldth Жыл бұрын
Nice, thx
@ismailananouche9980
@ismailananouche9980 Жыл бұрын
Clint please please we want a full ecom website with next js and tailwind please pleasee
@tausifmuftasinabid3195
@tausifmuftasinabid3195 Жыл бұрын
client component 😞
@leuzaoo
@leuzaoo Жыл бұрын
well job
@abdikadirQulle
@abdikadirQulle Жыл бұрын
can i get this code
@anuragdixit3147
@anuragdixit3147 10 ай бұрын
23:20
@anuragdixit3147
@anuragdixit3147 10 ай бұрын
14:03
The Story of Next.js
12:13
uidotdev
Рет қаралды 569 М.
白天使选错惹黑天使生气。#天使 #小丑女
00:31
天使夫妇
Рет қаралды 15 МЛН
Underwater Challenge 😱
00:37
Topper Guild
Рет қаралды 42 МЛН
هذه الحلوى قد تقتلني 😱🍬
00:22
Cool Tool SHORTS Arabic
Рет қаралды 61 МЛН
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 207 М.
do you know enough to get HIRED???
10:11
Code Commerce
Рет қаралды 3 М.
Next js 15 is Here… New Changes Again?!
8:13
JavaScript Mastery
Рет қаралды 146 М.
Next.js App Router Authentication (Sessions, Cookies, JWTs)
11:31
When RESTful architecture isn't enough...
21:02
Dreams of Code
Рет қаралды 273 М.
Set up Google OAuth with Next.js using Next-Auth!
21:00
Build SaaS with Ethan
Рет қаралды 25 М.
白天使选错惹黑天使生气。#天使 #小丑女
00:31
天使夫妇
Рет қаралды 15 МЛН