API

Auth Setup

At the end of this guide, you will have your AdonisJS API application configured and ready to use all Auth components.

This guide walks you through the foundational setup required before using any Auth components. You will install the necessary packages, create database migrations for email verification and password reset tokens, and configure your User model with helper mixins.

The setup includes:

  • Mail delivery for transactional emails
  • Rate limiting for form submissions
  • Dual-email system for safe email changes
  • User model mixins for email and password management
  • Middleware to protect routes from unverified accounts
  • A configurable frontend URL so transactional emails can link back to your separate frontend application

Unlike the Hypermedia and React variants, the API variant assumes your frontend (SPA, mobile app, or other consumer) lives in a separate codebase. The backend never renders HTML. Email links point at the frontend, and any state that the Hypermedia variant communicates with redirects or flash messages is replaced with HTTP status codes and JSON response bodies.

Unlock access
Only Plus subscribers can access the documentation
Log in now
Terms & License Agreement