SvelteKit User Authentication With Auth.js | OAuth 2.0 Authentication
ฝัง
- เผยแพร่เมื่อ 2 ส.ค. 2024
- 🎓 Join my learning platform for module based courses, learning exercises, and more: coderprep.com/
In this video we go into the SvelteKit integration of Auth.js, building an entire authentication system allowing you to use any OAuth 2.0 service. I also show off how to get the access token of a user for a given service, allowing you to communicate with any APIs related to your given OAuth 2.0 service. I decided to use GitHub authentication for this video, but you can really use anything you want. Thanks for watching!
Final project: github.com/coopercodes/svelte...
REMINDER: The GitHub link wont work above unless you create a .env file like shown in the video.
0:00 Project Showcase
1:00 SvelteKit Setup (@auth/sveltekit)
2:41 GitHub OAuth 2.0 Setup
6:30 Adding TailwindCSS (svelte-add tailwindcss)
7:50 Initializing Auth.js and SvelteKit (auth.ts)
11:17 Login User With Auth.js and SvelteKit
17:48 Show Logged In User
19:20 Sign Out User With Auth.js and SvelteKit
20:35 Get User Access Token For OAuth 2.0 Service
23:05 Use User Access Token To Access APIs - วิทยาศาสตร์และเทคโนโลยี
VERY GOOD
This is literally the best and most didactic video I saw so far with authentication. I kinda knew how to do, but I was not understanding why I was doing those stuff lol, thank you very much!!
Thanks for this man!
more sveltekit!
❤ thank you so much 🎉🎉
this helped a lot, thanks man :)
thanks
nice vid! it would be nice if you showed at the end of the video how to get rid of all the @ts-ignore's 😃
i got so excited to see a recently uploaded video on the subject ive been struggling with for weeks.. however ive yet again ran into another seemingly-ungooglable issue. i get a type error: invalid URL when attempting to load server data. back to the drawing board i guess.. im trying so hard to love svelte but i cant seem to get any practical use out of it aside from reusable components. any help would be appreciated.
session is empty when we run build preview? i have been struggling to fix this or i completely do no understand whats happening everything works fine in Dev but in build preview login success but no session is there?
I'm getting the same problem. Did you solve it?
can you create guide with credentials auth?
No mongo db? Am having tourble setting up with mongoose
can you show with password email im kinda stuck there
th-cam.com/video/ehmc1Zgu_EU/w-d-xo.html does not work with sveltekit 2 and svelte 5. There is not even anymore