Back to Browse

Implementing Auth from scratch - no dependencies!

3.6K views
Oct 29, 2024
19:54

💡 "Auth" is a double-abbreviation, it's used to refer to both Authentication (verifying who someone is) and Authorization (determining what they're allowed to do or access). Today we will look at how to implement an Auth system, from managing sessions, registering and logging users in, and of course: security! We'll protect the data and make sure users can only access what we want them to regardless of which route they are: a much better constraint to work with than simply protecting specific routes. Chapters ========= 00:00 - Intro 00:38 - Protecting Data x Protecting Routes 01:16 - Codebase walkthrough 02:00 - CSRF Protection with a Middleware 05:32 - Setup the Database and data schema 06:56 - Database actions: Login, Registration, Get users, ... 08:49 - Auth DB Actions 10:13 - Auth Session Management 11:06 - Auth User Actions 12:28 - Revalidating actions with demo 13:10 - Layout Route Component 14:12 - Login / Logout button 15:25 - Login/Register form [No-JS support] 17:46 - Protected Views and `deferStream` 18:40 - Public Route with User Data 19:30 - We're done!

Download

1 formats

Video Formats

360pmp432.4 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Implementing Auth from scratch - no dependencies! | NatokHD