How To Build Your Own Auth

How To Build Your Own Auth

In this episode of Syntax, Scott and Wes talk about building your own authentication — diving deep into JWT, sessions, tokens, cookies, local storage, CSRF, and how it all works! Prismic - Sponsor Prismic is a Headless CMS that makes it easy to build website pages as a set of components. Break pages into sections of components using React, Vue, or whatever you like. Make corresponding Slices in Prismic. Start building pages dynamically in minutes. Get started at prismic.io/syntax. LogRocket - Sponsor LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax. Hasura - Sponsor With Hasura, you can get a fully managed, production-ready GraphQL API as a service to help you build modern apps faster. You can get started for free in 30 seconds, or if you want to try out the Standard tier for zero cost, use the code “TryHasura” at this link: hasura.info. We’ve also got an amazing selection of GraphQL tutorials at hasura.io/learn. Show Notes 01:51 - Overview Level Up uses a JWT & secure cookie-based authentication and tracks sessions via a db table. Accounts.js 05:13 - JWT Base 64 encoded (not encrypted) token that contains data. We have both accessTokens and refreshTokens. JWT has three parts: Header What kind of algo was used Payload Data about the user Email Username UserID refreshToken, authToken, sessionId Signature This ensures that no one monkeyed with the above parts. If you change your email in the payload, the signature is not invalid, because in order to generate the signature, it uses the header and payload as part of it. accessToken A short lived JWT that contains the sessionToken, userId and expires after 90min. refreshToken A long lived JWT that contains just the sessionToken and doesn’t expire. JWT can be decoded and read, but you have to encode them with your secret. JWT can be stored anywhere, there are two main places: 20:26 - Cookies We use httpOnly, secure cookies to store the accessToken and the refreshToken. The accessToken is a session cookie and is removed whenever the browser is closed. The refreshToken is valid for 100 days but is also re-created and revalidated for 100 more days each time the accessToken is generated. Because these are httpOnly cookies, they cannot be accessed by JavaScript in the client and can only be set and removed on the server. Note: Safari has stricter rules than others for same domain cookies (e.g. localhost won’t work). 34:26 - Sessions Sessions are when a user logs in on a device. If you open a phone and log in and a computer and log in, those will create two different sessions. A session contains information about the user’s connection (like their IP) but it also contains the userId which allows us to create new accessTokens from a valid session. Sessions can be valid or invalid. This allows us to log anyone out by setting their session to valid: false. Sessions also have sessionToken which are generated on authentication or create account. 38:10 - CORS Cross-origin-resource-sharing Can be super tricky to get working cross-domain You usually have to actually visit the website for the cookie to be set, even with lax cors 46:06 - CSRF 48:47 - Authentication process bcrypt.js 52:13 - Helper Packages NextAuth.js is super easy Passport.js auth0 Links Caddy Fastify ××× SIIIIICK ××× PIIIICKS ××× Scott: reMarkable 2 Wes: Opration Odessa Shameless Plugs Scott: Node Fundamentals Authentication - Sign up for the year and save 25%! Wes: Advanced React - Use the coupon code ‘Syntax’ for $10 off! Tweet us your tasty treats! Scott’s Instagram LevelUpTutorials Instagram Wes’ Instagram Wes’ Twitter Wes’ Facebook Scott’s Twitter Make sure to include @SyntaxFM in your tweets

Jaksot(967)

911: Browsers in 2025: Whats up with Arc, Dia, Firefox, Chrome and Opera GX?

911: Browsers in 2025: Whats up with Arc, Dia, Firefox, Chrome and Opera GX?

Scott and Wes break down the state of web browsers in 2025, from the rise and fall of Arc and the fate of Firefox to hot takes on Opera GX, Raycast, and why power users might not be profitable. They compare rendering engines, rant about dev tools, and reveal what browser stats say about Syntax listeners. Show Notes 00:00 Welcome to Syntax! 01:37 Rendering Engines. 02:11 Arc Browser. 02:41 Microsoft Edge. 03:45 Why not Brave? 05:25 Brought to you by Sentry.io. 05:50 Google Manifest v2. 07:32 Opera. OperaGX. 10:13 Vivaldi. 11:23 The death of Arc Browser. 11:44 Dia? 14:43 No revenue from power-users. Letter to Arc Members. 15:38 Arc’s transition to a new browser. 17:02 Browser companies need to lock users fast! 19:42 Gecko. 19:45 Firefox. 21:08 Zen. 22:38 Webkit. There Still Arent Any iPhone Browsers With Custom Engines 29:18 Wtf is Ladybird? 34:14 Usage statistics. StatCounter.com. 39:32 Dev Tools experience ranked. 42:06 Tab experience. 43:37 Containers and profiles. Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads Wes: X Instagram Tiktok LinkedIn Threads Scott: X Instagram Tiktok LinkedIn Threads Randy: X Instagram YouTube Threads

16 Kesä 202547min

910: If Statements in CSS?

910: If Statements in CSS?

Wes and Scott talk about the new If statements in CSS, breaking down how they work, why they matter, and when to use them. They explore use cases, syntax quirks, and how this feature pushes CSS closer to true conditional logic—no JavaScript required. Show Notes 00:00 Welcome to Syntax! 01:30 Brought to you by Sentry.io 02:37 CSS If statements in action CSS if() functions & reading-flow (in Chrome 137) CodePen - If with style without attr 09:08 Advanced examples and the attribute function CodePen - CSS If() Themes 13:43 Mixing If statements with media queries CodePen - CSS If() Mixed Logic 16:54 Can’t this be done with classes? 18:16 The future of CSS: declarative APIs CSS Battle LIVE! in Denver | Switch Edition 21:10 Is CSS now a programming language? Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads Wes: X Instagram Tiktok LinkedIn Threads Scott: X Instagram Tiktok LinkedIn Threads Randy: X Instagram YouTube Threads

11 Kesä 202524min

909: Handling and Throwing Errors

909: Handling and Throwing Errors

We break down how to properly throw, catch, and log errors in JavaScript and TypeScript. They cover client-side and server-side strategies, using tools like Sentry, and how to handle errors without taking down your whole app. Show Notes 00:00 Welcome to Syntax! 01:19 Error terminology. 01:42 Thrown and catching. 03:01 What’s in an error. 04:09 Name and message. 04:42 Stack. 07:12 Node system errors. 07:34 Messages: strings, objects, or custom errors. 08:19 Throwing errors. 12:01 Promise errors. 12:10 Try catch block, .catch(). 14:13 Using awaited-to. 15:10 Finally. 16:29 promise.try() 17:14 Re-throwing errors. Error Cause 18:12 Client-side errors. 18:15 Catching at different levels. 18:51 Displaying errors. 21:59 Transforming server errors into client errors. 24:12 Error boundaries. 25:26 Server errors. 26:10 JSON API. 27:41 HTTP response codes. 30:09 Logging and solving errors. 31:16 Proudly supported by Sentry.io. Logging within Sentry 36:16 TypeScript and errors. Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads Wes: X Instagram Tiktok LinkedIn Threads Scott: X Instagram Tiktok LinkedIn Threads Randy: X Instagram YouTube Threads

9 Kesä 202539min

908: Storybook Has Evolved w/ Jeppe Reinhold

908: Storybook Has Evolved w/ Jeppe Reinhold

Wes and Scott talk with Jeppe Reinhold about Storybook 9’s powerful new features—including drastically reduced bloat, seamless Vite integration, and next-level component testing. They dive into visual regression testing, accessibility, performance, and best practices for writing robust, isolated UI components developers can actually enjoy testing and documenting. Show Notes 00:00 Welcome to Syntax! 01:40 What is Storybook? 03:48 How Storybook makes component design easier 04:41 Vite integration and compatibility with other tools Vite webpack RSpack 06:50 Storybook’s significantly smaller bundle size e18e polka 13:31 Upgrading to Storybook 9 17:34 Testing components with Storybook Vitest 19:51 How do you write a component “story”? 24:29 Brought to you by Sentry.io 24:54 How visual testing works 28:38 How Storybook makes money 29:33 Best practices for component design 32:24 Mocking and testing strategies 34:49 Accessibility testing 40:51 Add-ons and future features 44:43 Storybook’s documentation 46:33 Sick Picks + Shameless plugs Sick Picks Jeppe: JBL Boombox 3 Wi-Fi Shameless Plugs Jeppe: chromatic Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads Wes: X Instagram Tiktok LinkedIn Threads Scott: X Instagram Tiktok LinkedIn Threads Randy: X Instagram YouTube Threads

4 Kesä 202550min

907: Wes’ New Site: Gatsby → React Server Components

907: Wes’ New Site: Gatsby → React Server Components

Wes rebuilt his personal site from Gatsby to a modern stack using Waku, React Server Components, and Cloudflare Workers — all while keeping the same design. Scott and Wes break down the pain points with Next.js, MDX, image handling, caching, and the custom setup that now powers a blazing-fast blog. Show Notes 00:00 Welcome to Syntax! 01:03 Barcelona Conference. 04:09 Brought to you by Sentry.io. 04:33 Existing stack, goodbye to Gatsby. 06:11 New stack, the goals for moving. 06:56 So what is the new stack? 08:32 Challenges with NextJS. 08:58 Problems with plugins. 09:30 Problems with dynamic imports. 10:21 Problems with Cloudflare deployment. 12:37 Landing on Waku. 13:59 Hot Tips functionality updates. 16:30 Blog Posts + JavaScript Notes. 17:09 Moving from Gatsby. 19:03 Page speeds. 19:29 Removing nav resizing process. 21:03 Writing custom MDX plugins. 23:28 Hosting. 24:08 Why is the build so fast? 28:01 Pricing. 32:25 Caching. 34:49 Migration errors. 36:37 CSS. Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads Wes: X Instagram Tiktok LinkedIn Threads Scott: X Instagram Tiktok LinkedIn Threads Randy: X Instagram YouTube Threads

2 Kesä 202544min

906: Tech Startups and Raising Money with Dan Levine (Vercel, Sentry, Mux…)

906: Tech Startups and Raising Money with Dan Levine (Vercel, Sentry, Mux…)

Wes and Scott talk with VC Dan Levine about how developers can raise venture capital, what investors look for in early-stage startups, the realities of bootstrapping vs. fundraising, and why great ideas often start as simple side projects. Show Notes 00:00 Welcome to Syntax! 00:55 Dan’s background and career 03:10 Is it common for tech investors to come from a tech background? 04:40 How can developers raise money? 08:35 What investors look for 12:39 How much funding is enough? 15:41 Are founders working with multiple investors? 18:26 What can you use the money for? 22:49 How much influence do investors have in the business? 29:56 Brought to you by Sentry.io 29:56 How involved are VCs in the business? 34:22 How do you know a startup is in trouble—and what can you do about it? 38:56 How much of the company do investors own? 40:43 What’s the endgame for investors? 44:02 How do acqui-hires work? 46:29 Is the AI space a real opportunity or just hype? 53:22 Sick Picks + Shameless Plugs Sick Picks Dan: Dandelion Chocolate Jules Pizza Shameless Plugs Dan: Linear Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads Wes: X Instagram Tiktok LinkedIn Threads Scott: X Instagram Tiktok LinkedIn Threads Randy: X Instagram YouTube Threads

28 Touko 202556min

905: You Should Learn Nuxt!

905: You Should Learn Nuxt!

CJ steps in for Scott and joins Wes to share his experience working with Nuxt, from routing and data fetching to the pros and cons of the framework. They break down the Nuxt ecosystem, directory structure, and how it handles server routes and modules. Show Notes 00:00 Syntax Meetup! 00:26 Welcome to Syntax 01:21 The deal with Nuxt. CJ’s Nuxt Course. 02:51 Why do you like Vue? 04:52 Brought to you by Sentry.io. 05:17 Routing with Nuxt. h3 - The Web Framework for Modern JavaScript Era. Nuxt Guides. 06:12 Built on Nitro. 06:49 The Nuxt Ecosystem. 07:52 API Route Support. 08:15 Nuxt Directory Structure. 09:09 Does Nuxt do too much for you? 11:15 Data fetching in a Nuxt app. 13:25 RPC, Form Actions, Server Actions? 15:00 Nuxt Server Folder Hastle. 15:57 useFetch Hook. CJ’s Nuxt Crash Course. 17:29 Core Modules and Community Modules? Nuxt Modules. shadcn-nuxt. @nuxt/ui. DaisyUI. Pinia. 21:17 Nuxt Hosting. Deploy. hub.nuxt. 23:59 Anything you don’t like? Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads Wes: X Instagram Tiktok LinkedIn Threads Scott: X Instagram Tiktok LinkedIn Threads Randy: X Instagram YouTube Threads

26 Touko 202527min

904: React vs Svelte × Windsurf Worth $3B × Typescript as Const × Layout Shift Tricks × More

904: React vs Svelte × Windsurf Worth $3B × Typescript as Const × Layout Shift Tricks × More

In this potluck episode of Syntax, Wes and CJ answer your questions about OpenAI’s $3B Windsurf acquisition, the evolving role of UI in an AI-driven world, why good design still matters, React vs. Svelte, and more! Show Notes 00:00 Welcome to Syntax! Devs Night Out 02:35 OpenAI acquires Windsurf for $3B Windsurf Ep 870: Windsurf forked VS Code to compete with Cursor. Talking the future of AI + Coding 05:20 What is the future of UI now that AI is such a heavy hitter? 08:45 Handling spam submissions on websites Cloudflare Turnstile 14:18 Duplicating HTML for desktop and mobile websites? 17:03 Is it okay to use a JSON file for simple website data? 19:04 How to handle anonymous and duplicate users Better-Auth 21:55 Working with TypeScript Object.keys() and “any” vs “@ts-ignore” 25:51 Brought to you by Sentry.io 26:38 What is the difference between React and Svelte? 30:24 How should you name your readme file? 31:55 How do you find time to refactor code? 35:20 Best practices for testing responsiveness Polypane 39:19 Avoiding layout shift with progressive enhancement 46:56 Sick Picks + Shameless Plugs Sick Picks CJ: Portable Chainsaw Wes: White Lotus Shameless Plugs CJ: Nuxt Wes: Full Stack App Build | Travel Log w/ Nuxt, Vue, Better Auth, Drizzle, Tailwind, DaisyUI, MapLibre Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads Wes: X Instagram Tiktok LinkedIn Threads Scott: X Instagram Tiktok LinkedIn Threads Randy: X Instagram YouTube Threads

21 Touko 202551min

Suosittua kategoriassa Politiikka ja uutiset

rss-ootsa-kuullut-tasta
aikalisa
ootsa-kuullut-tasta-2
tervo-halme
politiikan-puskaradio
rss-kuka-mina-olen
rss-vaalirankkurit-podcast
otetaan-yhdet
et-sa-noin-voi-sanoo-esittaa
aihe
rss-podme-livebox
rikosmyytit
radio-antro
rss-tasta-on-kyse-ivan-puopolo-verkkouutiset
the-ulkopolitist
rss-raha-talous-ja-politiikka
linda-maria
eevan-politiikkapodi-totuuksia-suomesta