Back to Browse

User Authentication with Pocketbase and SvelteKit | Full Auth Solution

5.1K views
Jul 10, 2023
21:05

This is part 6 in the PocketBase series. In this video I show how to implement user authentication using PocketBase and SvelteKit. This is a full authentication solution. I first show how to register a user. Then we setup our hooks.server file to keep our authentication up to date and send user information to all our routes through locals using ( PocketBases built in methods exportToCookie, loadFromCookie, and authRefresh functions). Then we log a user in using a login route and PocketBases authWithPassword on the user collection. Then we move to a protected route that only allows access to authenticated users and also pulls out some user info to display it. Lastly I show how to implement a logout button. On the way I also cover removing pre-load on the links to prevent errors on the auth and logout routes! Lots of good stuff in this one! I hope that you find this helpful! My channel membership is live check it out here!: https://www.youtube.com/channel/UCwPrPv9eS7Xgfp_wi7uxt0g/join Membership perk video: https://youtu.be/FJgKifAThdU Need help? visit https://www.consultingninja.tech Check out my channel @ConsultingNinja for more videos like these. Source Code Available Here: https://github.com/consultingninja/pbKitUserAuth PocketBase Increase Security when using http (Part 5) Here: https://youtu.be/k57AqzqhiDY PocketBase Realtime DB Subscriptions Video (Part 4) Here: https://youtu.be/5-1HLCXRBPM PocketBase Google Auth App Video (Part 3) Here: https://youtu.be/Ig_RMc0GFw4 PocketBase CRUD App Video (Part 2) Here: https://youtu.be/Zm_DIu0MaBs PocketBase Overview & Setup Video (Part 1) Here: https://youtu.be/NuLua3EXXVQ PocketBase Docs: https://pocketbase.io/docs/ PocketBase JavaScript SDK: https://github.com/pocketbase/js-sdk

Download

0 formats

No download links available.

User Authentication with Pocketbase and SvelteKit | Full Auth Solution | NatokHD