Hi there! I'm Jan, a web developer and solopreneur from Germany. And this is my RU-vid channel all about React, Next.js, and modern web development.
I created this channel to bring more people into the wonderful world of React and Next.js, helping them build better apps. If you're learning to build websites and web apps, especially using JavaScript frameworks like React or Next.js, then this is the place for you.
Sir, your demonstration is far better than others. Just an advice if you create a playlist where viewer can get all the auth/next.js related videos in one place that would be great
I Also Created Same Video But i had the other issue of it have one flaw of the ad loading only if the page is visited first time but if i try to navigate it does load (you have to refresh page for it) so i added dependency of usepathname value and useSearchParams of 'next/navigation' of app router which solves this issue.
I think the minor annoying error is because might get push() a few times so I change the code slightly, and the error goes away. useEffect(() => { const initializeAds = () => { if (typeof window !== "undefined" && (window as any).adsbygoogle) { try { ((window as any).adsbygoogle = (window as any).adsbygoogle || []).push({}); } catch (error: any) { console.log(error.message); } } }; initializeAds(); }, []);
AdSense has an inbuilt cookie consent screen that you need to enable in their dashboard. Once done, as soon as you load the adsense script as shown in the video, the cookie consent screen should automatically show.
And yeah if they don't consent, they won't see ads. I have a 97% consent rate on all my pages together. People are used to hitting "Consent" so don't worry too much about it
@@webdevjan thanks for letting me know this things. Also, i use google analytics for which i have been using banner, so after adsense, do i have to show 2 banner? One for adsense (turned on from dashboard) and another for google analytics?
Update: To use the server actions provided by NextAuth inside client components, I moved the functions to a different file called "actions.ts" and exported them with the "use server" directive. Check out the actions.ts file in the GitHub repository to see how it works! 👍 I also improved the starter template a lot after recording this video. If you want to check it yourself you can find the link to it in the description. :) As always, if something is unclear or you have questions, feel free to ask me in the comments
idk why but i keep getting error 404 when clicking the button and the terminal shows this GET /api/auth/session 404 in 456ms GET /api/auth/session 404 in 32ms POST /api/auth/_log 404 in 32ms POST /api/auth/_log 404 in 15ms GET /api/auth/providers 404 in 44ms POST /api/auth/_log 404 in 40ms GET /api/auth/error 404 in 27ms and the session object is undefined