
@codthing
- Member Since
- Apr 4, 2025
- Lessons Completed
- 97
- Comments Contributed
- 13
- Hours Watched
- 12.45
Recent Activity
Here's what @codthing has been up to this past year
-
-
Upvoted comment AdonisJS uses Opaque Access Tokens (OAT), sometimes referred...
-
Replied to Tom Gobich,Is the auth-token generated by default in AdonisJS...
I want to use a JWT token because I'm considering that the frontend might need to check the token's expiration time to proactively refresh-token. I'm not sure which approach is better. I'd love to hear your opinion.
-
Replied to const jwt_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM...
const adonisjs_token = "oat_NjA.N1J1SGpxVlVLZjdLc2NmTVJXdUxPWDFkbjFrWFpIbmo5VmRSVVVRczEzNjg1NTc4Mzc" const decoded_adonisjs_token = jwt_decode(adonisjs_token) console.log(decoded_adonisjs_token); // 'Invalid token specified: Unexpected non-whitespace…racter after JSON at // position 1 (line 1 column 2)', stack: 'InvalidTokenError\n
Copied! -
Replied to Tom Gobich,Is the auth-token generated by default in AdonisJS...
const jwt_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"; const decoded_jwt_token = jwt_decode(token); console.log(decoded_jwt_token); //{sub: '1234567890', name: 'John Doe', iat: 1516239022}
Copied! -
Commented on post Thank You for Watching!
Tom Gobich,Is the auth-token generated by default in AdonisJS a JWT token? If not, what should the frontend use to parse it? I tried parsing it with jwt-decode。
const authConfig = defineConfig({ default: 'api', guards: { api: tokensGuard({ provider: tokensUserProvider({ tokens: 'accessTokens', model: () => import('#models/user'), }), }), }, })
-
Commented on post Thank You for Watching!
Thank you, Tom Gobich. Absolutely brilliant course! I spent two weeks watching all your videos, and even though I relied on a translator, your clear explanations kept everything crystal clear. I’m confident this is a fantastic starting point for understanding and using AdonisJS. Thanks again!
-
Completed lesson Thank You for Watching!
-
Replied to When testing in Postman, I encounter a "slug uniqueness error...
The issue lies in the fact that only English letters are supported, so we should first ensure that the title is in English, and then verify its uniqueness. It is recommended to use the transliteration library.
-
Commented on post Uploading Movie Cover Images in our Create or Edit Form
When testing in Postman, I encounter a "slug uniqueness error" on the third consecutive form submission without changing the input. The error occurs in the store method, which validates the request, processes the poster file, and creates a movie record. The database throws a duplicate key error because the slug already exists, violating the movies_slug_unique constraint. This likely happens because the slugify method, provided in the course, fails to generate a unique slug for repeated sub
-
Completed lesson Uploading Movie Cover Images in our Create or Edit Form
-
-
Upvoted comment Hi codthing!Thank you for the great suggestion! You can now ...
-
Completed lesson Paginated Admin Movie Table
-
Completed lesson Counting Stats for our Admin Dashboard
-
Completed lesson Creating An Admin Layout
-
Completed lesson Filtering, Preloading, and Sorting By Relationship
-
Completed lesson Uploading and Displaying User Avatars
-
Completed lesson Saving All Or Nothing with Database Transactions
-
Completed lesson Using Dependency Injection to Update A User's Profile
-
Completed lesson How to Create and Fix Missing User Profiles in Your Application
-
Completed lesson Persist Filters Easily with Lucid's Query String Method
-
Completed lesson Defining A Composite Unique Constraint
-
Completed lesson Filtering By User's Watched Status
-
Completed lesson Allowing Users To Toggle A Movie As Watched
-
Completed lesson Listing and Filtering User Watchlist Items
-
Completed lesson Toggling A Movie in an Authenticated User's Watchlist
-
Commented on post An Alternative Approach to Many-To-Many Relationships
If the GitHub repository includes the relationship diagram from the video's opening, it would be helpful for learning.
-
Completed lesson An Alternative Approach to Many-To-Many Relationships
-
Completed lesson Pagination First, Last, Next, and Previous Buttons
-
Completed lesson How To Paginate Filtered Query Results
-
Completed lesson Validating Query String Filter Values
-
Completed lesson Filtering A Query By Pattern Likeness
-
Completed lesson Creating A Movie List Page
-
Completed lesson Remembering A User's Authenticated Session
-
Completed lesson Logging In An Existing User
-
Completed lesson Logging Out An Authenticated User
-
Completed lesson Checking For and Populating an Authenticated User
-
Completed lesson Creating A Login Form and Validator
-
Completed lesson Creating An EdgeJS Form Input Component
-
Completed lesson Reusing Old Form Values After A Validation Error
-
Completed lesson Displaying Validation Errors and Validating from our Request
-
Completed lesson Validating Form Data with VineJS
-
Completed lesson Accepting Form Data
-
Completed lesson How To Query, Sort, and Filter by Pivot Table Data
-
Completed lesson How To Create Factory Relationships from a Pool of Data
-
Completed lesson Many-To-Many Model Factory Relationships
-
Completed lesson Defining Many-To-Many Relationships and Pivot Columns
-
Completed lesson Using Eager and Lazy Loading to Load A Movie's Writer and Director
-
Completed lesson Listing and Counting a Writer's Movies
-
Completed lesson Listing A Director's Movies with Relationship Existence Queries
-
Completed lesson Seeding Movies with One to Many Model Factory Relationships
-
Completed lesson Defining One to Many Relationships with Lucid Models
-
Completed lesson Cascading and Deleting Model Relationships
-
Completed lesson Querying Relationships and Eager Vs Lazy Loading
-
Completed lesson Model Factory Relationships
-
Completed lesson Defining One to One Relationships Within Lucid Models
-
Completed lesson Generating A Unique Movie Slug With Model Hooks
-
Completed lesson Querying Recently Released and Coming Soon Movies
-
Completed lesson Tapping into Model Factory States
-
Completed lesson Reusable Query Statements with Model Query Scopes
-
Completed lesson SQL Parameters and Injection Protection
-
Completed lesson Adding A Profile Model, Migration, Factory, and Controller
-
Completed lesson Altering Tables with Migrations
-
Completed lesson Unmapped and Computed Model Properties
-
Completed lesson Querying Our Movies with the Query Builder
-
Completed lesson Stubbing Fake Data with Model Factories
-
Completed lesson Defining Required Data with Seeders
-
Completed lesson The Basics of CRUD
-
Completed lesson Defining Our Models
-
Completed lesson Introducing Lucid Models
-
Completed lesson The Flow of Migrations
-
Completed lesson Introducing and Defining Database Migrations
-
Completed lesson Understanding our Database Schema
-
Completed lesson Configuring Lucid and our Database Connection
-
Completed lesson Easy SVG Icons with Edge Iconify
-
Completed lesson HTTP Method Spoofing HTML Forms
-
Completed lesson Form Basics and CSRF Protection
-
Completed lesson Share vs Global Data Flow
-
Completed lesson State vs Share Data Flow
-
Completed lesson Extracting A Layout Component
-
Completed lesson Use Slots To Make A Button Component
-
Completed lesson Component Tags, State, and Props
-
Completed lesson Making A Reusable Movie Card Component
-
Completed lesson HTML Attribute and Class Utilities
-
Completed lesson EdgeJS Templating Basics
-
Completed lesson Easy Imports with NodeJS Subpath Imports
-
Completed lesson Quick Start Apps with Custom Starter Kits
-
Replied to After testing with these two route methods, there were no changes...
//cache service export class CacheService { async has(...keys: string[]) { return redis.exists(keys) } async get(key: string) { const value = await redis.get(key) return value && JSON.parse(value) } async set(key: string, value: any) { return redis.set(key, JSON.stringify(value)) } async delete(...keys: string[]) { return redis.del(keys) } async flushDb() { return redis.flushdb() } } const cache = new CacheService() export default cache
Copied! -
Replied to After testing with these two route methods, there were no changes...
//redis controller export default class RedisController { public async destroy({ response, params }: HttpContext) { await cache.delete(params.slug) return response.redirect().back() } public async flush({ response }: HttpContext) { await cache.flushDb() return response.redirect().back() } }
Copied! -
Commented on post Deleting Items and Flushing our Redis Cache
After testing with these two route methods, there were no changes in the Redis database. The three movie records still remain—they haven't been destroyed or deleted.
//routes.ts router.get('/redis/flush', [RedisController, 'flush']).as('redis.flush') router.get('/redis/:slug', [RedisController, 'destroy']).as('redis.destroy')
Copied! -
Completed lesson Deleting Items and Flushing our Redis Cache
-
Completed lesson Improved Caching with Redis
-
Completed lesson Environment Variables and their Validation
-
Completed lesson Singleton Services and the Idea of Caching
-
Completed lesson Defining A Structure for our Movie using Models
-
Completed lesson Cleaning Up Routes with Controllers
-
Completed lesson Extracting Reusable Code with Services
-
Completed lesson Listing Movies from their Markdown Files
-
Completed lesson Reading and Supporting Markdown Content
-
Completed lesson Setting Up Tailwind CSS
-
Completed lesson Vite and Our Assets
-
Completed lesson Validating Route Parameters
-
Completed lesson Loading A Movie Using Route Parameters
-
Completed lesson Linking Between Routes
-
Completed lesson Rendering a View for a Route
-
Completed lesson Routes and How To Create Them
-
Completed lesson VS Code Extensions and Configuration
-
Completed lesson Project Structure
-
Completed lesson Creating A New AdonisJS 6 Project
-
Completed lesson What We'll Need Before We Begin
-
Completed lesson Introducing AdonisJS
-
Account created Welcome to Adocasts, @codthing!