How To Configure & Use Multiple Authentication Guards

Опубликовано: 06 Август 2026
на канале: Adocasts
236
16

Learn how to use web & API auth together in AdonisJS

👍 If You Enjoy This Video, Consider Hitting The Like Button!

🥁 Subscribe To Stay Notified For New Videos: https://www.youtube.com/adocasts?sub_...

🎯 Subscribe to Adocasts Plus to gain access to all our lessons and more!
https://adocasts.com/pricing

We'll walk through how to set up a new AdonisJS project with both session and opaque access token authentication guards. We'll then walk through a quick authentication demo for each and disable CSRF on our API routes.

Repository:
https://github.com/adocasts/adonisjs6...

🕑 Chapters
00:00 - Creating our project
01:18 - Cleaning up for auth reconfiguration
02:25 - Configuring opaque access token auth
03:41 - The default auth guard & config changes
04:45 - Rigging up a quick auth system
06:40 - Testing session authentication
07:02 - Testing access token authentication
07:25 - Omitting CSRF protection on API routes
07:45 - Testing the access token

-------------------------Socials--------------------------

🕸️ Website: https://adocasts.com
🦋 Blusky: https://bsky.app/profile/adocasts.com
🐦 Twitter:   / adocasts  
👍 GitHub: https://github.com/adocasts