- 60
- 389 236
Digital CEO
United States
เข้าร่วมเมื่อ 2 พ.ค. 2017
Simple and step by step tutorials on front end web development to make your coding life easier #react #nextjs #webdevelopment
Google Auth with Nextjs 14 app directory
CONNECT ON MY DISCORD COMMUNITY:
discord.gg/5zsdrxH8m8
Note: When you receive the profile info from Google via the id_token, decode it and save the user's info in your own cookie or database. If you save and rely on the direct id_token jwt value for future profile info like I did in the tutorial, remember it will expire, requiring additional checks to re-fetch it. An easier way is to store the user's name and profile photo links in your database unless you want to refresh profile info from Google more frequently.
0:00 intro
0:38 Demo
2:36 Create Google Project
4:00 Google Auth Api route
9:18 Google Sign in Button
10:14 Google Tokens
12:34 Create Login Cookie
14:00 Google Profile Token
15:28 Check if user is Logged in
17:00 Header Profile Photo
20:28 Logout Button/Route
23:00 Re-use saved user token on logins
27:00 Some points
SOCIALS:
Twitter: omarel
Website: www.omarel.com
LinkedIn: www.linkedin.com/in/omarelbaga
GitHub: github.com/oelbaga
discord.gg/5zsdrxH8m8
Note: When you receive the profile info from Google via the id_token, decode it and save the user's info in your own cookie or database. If you save and rely on the direct id_token jwt value for future profile info like I did in the tutorial, remember it will expire, requiring additional checks to re-fetch it. An easier way is to store the user's name and profile photo links in your database unless you want to refresh profile info from Google more frequently.
0:00 intro
0:38 Demo
2:36 Create Google Project
4:00 Google Auth Api route
9:18 Google Sign in Button
10:14 Google Tokens
12:34 Create Login Cookie
14:00 Google Profile Token
15:28 Check if user is Logged in
17:00 Header Profile Photo
20:28 Logout Button/Route
23:00 Re-use saved user token on logins
27:00 Some points
SOCIALS:
Twitter: omarel
Website: www.omarel.com
LinkedIn: www.linkedin.com/in/omarelbaga
GitHub: github.com/oelbaga
มุมมอง: 432
วีดีโอ
How to add Google Analytics to your Next.js 14 site with app router
มุมมอง 2.6K5 หลายเดือนก่อน
CONNECT ON MY DISCORD COMMUNITY: discord.gg/5zsdrxH8m8 SOCIALS: Twitter: omarel Website: www.omarel.com LinkedIn: www.linkedin.com/in/omarelbaga GitHub: github.com/oelbaga
How to stop dev emails from going to spam
มุมมอง 1136 หลายเดือนก่อน
Email platforms like gmail and yahoo now require email authentication on domain names to be allowed through their system. This involves adding email authenticating records to the DNS of the domain you are sending emails from. CONNECT ON MY DISCORD COMMUNITY: discord.gg/5zsdrxH8m8 SOCIALS: GitHub: github.com/oelbaga Twitter: omarel Website: www.omarel.com LinkedIn: www.linkedin.com/i...
Zuckerberg Reveals Challenges of AI Data Centers (Meta, AI, Energy Insights)
มุมมอง 2836 หลายเดือนก่อน
CONNECT ON MY DISCORD COMMUNITY: discord.gg/5zsdrxH8m8 SOCIALS: Twitter: omarel Website: www.omarel.com LinkedIn: www.linkedin.com/in/omarelbaga GitHub: github.com/oelbaga
Will AI Steal Our Jobs? Reacting to Predictions on AI in Software Engineering
มุมมอง 876 หลายเดือนก่อน
CONNECT ON MY DISCORD COMMUNITY: discord.gg/5zsdrxH8m8 SOCIALS: Twitter: omarel Website: www.omarel.com LinkedIn: www.linkedin.com/in/omarelbaga GitHub: github.com/oelbaga
Self host Next.js website on an Ubuntu server with Auto Deploy on commits!
มุมมอง 4.3K6 หลายเดือนก่อน
To host Next.js app/website you only need a server running Node.js. In this video you will learn how to host a next.js website or app on an ubuntu (linux) server in the cloud which you can get from Digital ocean or AWS. As a note, In this example we are not using Vercel, Netlify or any of the app hosting platforms on digital ocean or aws as those are also abstractions. We are setting up a clean...
Men Crash an All Women Tech conference...
มุมมอง 1.2Kปีที่แล้ว
CONNECT ON MY DISCORD COMMUNITY: discord.gg/5zsdrxH8m8 SOCIALS: Twitter: omarel Website: www.omarel.com LinkedIn: www.linkedin.com/in/omarelbaga GitHub: github.com/oelbaga
What happened to Elon Musk Neuralink monkeys: Grisly Details...
มุมมอง 2.8Kปีที่แล้ว
CONNECT ON MY DISCORD COMMUNITY: discord.gg/5zsdrxH8m8 SOCIALS: Twitter: omarel Website: www.omarel.com LinkedIn: www.linkedin.com/in/omarelbaga GitHub: github.com/oelbaga
You feel safe in cars, but little do you know how they spy
มุมมอง 70ปีที่แล้ว
In a new study by Mozilla, 24 companies were found collecting private data on drivers of their cars. CONNECT ON MY DISCORD COMMUNITY: discord.gg/5zsdrxH8m8 SOCIALS: Twitter: omarel Website: www.omarel.com LinkedIn: www.linkedin.com/in/omarelbaga GitHub: github.com/oelbaga
iPhone’s radiation levels spark backlash
มุมมอง 153ปีที่แล้ว
0:00 iPhone banned 2:00 Google Steals User Locations 4:00 TikTok Teen privacy Tech News - September 2023 CONNECT ON MY DISCORD COMMUNITY: discord.gg/5zsdrxH8m8 SOCIALS: Twitter: omarel Website: www.omarel.com LinkedIn: www.linkedin.com/in/omarelbaga GitHub: github.com/oelbaga
They exploit developers...devs must unite
มุมมอง 83ปีที่แล้ว
CONNECT ON MY DISCORD COMMUNITY: discord.gg/5zsdrxH8m8 SOCIALS: Twitter: omarel Website: www.omarel.com LinkedIn: www.linkedin.com/in/omarelbaga GitHub: github.com/oelbaga
Learn CRUD with React/Next.JS and MySQL (Complete tutorial)
มุมมอง 39Kปีที่แล้ว
In this video you'll learn how to do all CRUD operations with Next.JS api and MySQL database, or any database you choose to use. We'll create an API in Next.JS and then learn how to read, create, update and delete data through that API. The concept generally works with any database but in this demo you'll use a MySQL database. CONNECT ON MY DISCORD COMMUNITY: discord.gg/5zsdrxH8m8 0:00 intro 1:...
Most annoying problem with GIT and NextJS
มุมมอง 276ปีที่แล้ว
CONNECT ON MY DISCORD COMMUNITY: discord.gg/5zsdrxH8m8 SOCIALS: Twitter: omarel Website: www.omarel.com LinkedIn: www.linkedin.com/in/omarelbaga GitHub: github.com/oelbaga #github #git #sourcecontrol #react #nextjs #vercel
How React/NextJS logins actually work. Sessions VS oAuth
มุมมอง 734ปีที่แล้ว
How React/NextJS logins actually work. Sessions VS oAuth
Change parent state from child components in React/NextJS
มุมมอง 6K2 ปีที่แล้ว
Change parent state from child components in React/NextJS
React form validation with react hook form. Simple!
มุมมอง 1K2 ปีที่แล้ว
React form validation with react hook form. Simple!
Make full viewport sections snap scroll in React (scroll to sections on click, animation, more)
มุมมอง 15K2 ปีที่แล้ว
Make full viewport sections snap scroll in React (scroll to sections on click, animation, more)
Should you learn code from Tutorials? [REACTION]
มุมมอง 1812 ปีที่แล้ว
Should you learn code from Tutorials? [REACTION]
3 costly mistakes developers make with NextJS
มุมมอง 4.4K2 ปีที่แล้ว
3 costly mistakes developers make with NextJS
Reacting to a day in the life of a Google Engineer
มุมมอง 1922 ปีที่แล้ว
Reacting to a day in the life of a Google Engineer
Convert an HTML Website to React/NextJS
มุมมอง 15K2 ปีที่แล้ว
Convert an HTML Website to React/NextJS
[Step by Step] Deploy NextJS on Ubuntu Digital Ocean (2 NextJS Apps on one server)
มุมมอง 39K2 ปีที่แล้ว
[Step by Step] Deploy NextJS on Ubuntu Digital Ocean (2 NextJS Apps on one server)
Solving the React 18 Double Render problem on useEffect
มุมมอง 9K2 ปีที่แล้ว
Solving the React 18 Double Render problem on useEffect
NextJS MySQL example. Get MySQL data into a react app using Node JS
มุมมอง 45K2 ปีที่แล้ว
NextJS MySQL example. Get MySQL data into a react app using Node JS
Vanilla React Image Slider from scratch - just 30 minutes - even easier than javascript sliders
มุมมอง 9502 ปีที่แล้ว
Vanilla React Image Slider from scratch - just 30 minutes - even easier than javascript sliders
Thank you Brother.
Thank you very much for these explanations! React is a great tool
Thank you so much!
Thanks brother!
Not a brilliant idea having your heavy keyboard keys mic'd up.
very helpfull video thankyou
Then what is the point of npm run build
Great Stuff! Thanks. And yes, you got a new subscriber to your channel today
Really good! I'm still getting over the fact that nextjs has to be built in situ. A build can always fail, so it seems very risky to overwrite your live site with some new code that needs to be built. Folk are likely handling this with containers but I think I'm going to try a blue/green strategy and switch the nginx config when the build has succeeded. I'm also a bit startled to see the PATH modified in the deployment pipeline. Why should I need to modify my pipeline every time my node version changes? I think I need a better solution there. God I wish we still had server guys.
this was an actual good video and it was not 1 hour long like other videos
This was a really great tutorial, thank you for walking us through the steps. I already knew most of them, but needed a refresh, especially on the pm2 part. Keep up the great work!
This guy is a genius. Thanks a lot. I was having a lot of issues with SSH keys but it's clear now
Thank you so much, i was banging my head on the wall with this SSH stuff !
pretty good, ty.
Very helpful content. Tnx so much! 🙏
How old is this. Is it NextJS14? I'm getting errors with usestate and useffect.
How to deploy this?
thanks bro
Thank you for the incredible video! I have a question: I’m currently using a droplet to host WordPress and would like to host a Next.js application on the same droplet. I followed your steps, but are there any additional considerations I should consider when hosting Next.js and WordPress on the same server?
It works! I applied google analytics on my nextjs personal website. Super helpful.
Wow, best video I've ever watched on TH-cam! Congratulations!!!
Thanks for sharing an amazing tutorial 🙏. I was really searching for the perfect one, and it is well explained 🙌
Thanks for sharing !!! This was very helpful!
Double like! This was clear, concise, and it worked.
interesante. Un carrito de compra seria interesante tambien.
Super helpful! Thanks so much
It's okay if we want to pass one or two state variables. But still react is bad when the application grows large and need to pass multiple state variables and their setters. It needs support from redux when the application grows large
8 hours of my life (of which I still didn't succeed in) summed up in 25 minutes. Now I can get on with the meat of my project. Thank you.
Man I just discovered your channel and I’m already addicted. You have a realtà nice way to deliver concepts
Do you winner my like and I subscribe. Thanks my fried. Ops, I`m from Rio de Janeiro - Brazil here
Thank you for the incredibly helpful content!
It was genius. Would hire immediately
Thats remarkable. Danke
something wrong with this. i tries to run two apps on same domain with subomains, but only one app runs on domain
Wr kill billions of chickens
this content is legendary !
The title reads 'Self host' - using Digital Ocean is not self hosting. How about using Ubuntu-server on a local machine to deploy a live Next.js app?
Digital ocean droplets are just ubuntu server under the hood, literally same thing, you can use this tutorial on any ubuntu server anywhere
@@haiffy yah it worked for me on my self hosted ubuntu. great tut
Great Tutorial though! Thanks a lot 🙂 Faced an issue while following your steps, solved it by doing this: Generate ssh key on the last step (github actions) using ed25519 instead of rsa, in my case generating using rsa gave me an error (Permission denied)
who else was paying attention to the mechanical key caps sound instead of the tutorial
Will the WordPress headless cms slow?
i cannot find the js file on app/api/hello, i also dont use resource. also whatever i do its always 404
"folder" -> directory
Thank you so much for this amazing tutorial! I followed your steps and successfully implemented Google Auth in my Next.js project. Your clear explanations and detailed instructions made it easy to understand. Keep up the great work!
I have a question for you, actually more of a suggestion. I couldn't really find any content on this topic on the internet or TH-cam. If the session comes from the backend and this session needs to be used for logging in (for authentication processes or other operations), how can we set this up using NextAuth? Additionally, how can we take the session's expiration date from the information coming from the backend and process it?
I don’t fully understand the question. Can you explain again. I don’t use the nextauth package because I do auth myself. I authenticate the user based on cross checking credentials entered against their credentials stored in the database and the create a cookie. Then on each route I check if the cookie is still valid. If not I redirect them to the login page.
@@thedigitalceo This is the question I actually wanted to ask. Let's assume we send login credentials to an API with the endpoint 'localhost:5031/api/login'. This API returns a token and an expiration date to us. We need to log in using this information, meaning the token sent by the API should be set as the token in the credential section when logging in with NextAuth. At the same time, the expiration date of the token should be set using the expirationdata value received from the API. We need to check the token's expiration here, and if the token has expired, the user's session should be terminated. I actually wanted to ask for a video recommendation on this topic, specifically on how to log in a user using NextAuth with any token coming from the backend.
@@thedigitalceo This is the question I actually wanted to ask. Let's assume we send login credentials to an API with the endpoint 'localhost:5031/api/login'. This API returns a token and an expiration date to us. We need to log in using this information, meaning the token sent by the API should be set as the token in the credential section when logging in with NextAuth. At the same time, the expiration date of the token should be set using the expirationdata value received from the API We need to check the token's expiration here, and if the token has expired, the user's session should be terminated. I actually wanted to ask for a video recommendation on this topic, specifically on how to log in a user using NextAuth with any token coming from the backend.
Great Job !!! Thnks. - My headache is now off.😁
Yeah but how do we do pagination on the data instead of fetchjing every single on of them ?!?!?!?!?
why don't you tell us where we have to move the .next folder? Who tf creates a project on the production Server???
Meuurika is shuuiiiittt. Elom monsk is a shuuiiit...he got the ttatment from israfail and came back saying freedom of speech is anti semitism...all crap
I'm trying to reproduce this in 2024, but i cant install or build the next app in the droplet due to a low memory, how can I fix this?
It was just thi. export NODE_OPTIONS=--max_old_space_size=1024
There is a slight problem with this and it is that you cannot run build while running PM2 because building causes the files that are being served by PM2 to be modified, you have to copy them to another directory before hand, I think you can use `next build [directory to which you copied the files]` to fix this, otherwise awesome video! edit: use next JS standalone mode, not `next build [directory]`!
A good point. I haven’t run into a lot of issues in most cases but what you suggested is definitely best practice. Thank you!