Auth Configuration

Configure which sign-in methods are available in your project: Dashboard → Auth → Configuration.

Sign-in methods

MethodDescriptionUse when
Email + PasswordTraditional sign-up/sign-in with email and passwordWeb apps, B2B, forms
Email OTPPasswordless sign-in via 6-digit code to emailMobile apps, modern SaaS
Phone OTPPasswordless sign-in via SMS codeConsumer apps, emerging markets
BothEmail+password and/or OTP on email or phoneMaximum flexibility

Email only

Available endpoints:

  • POST /auth/registeremail, password, name, customFields
  • POST /auth/loginemail, password
  • POST /auth/otp/sendemail (if OTP enabled)
  • POST /auth/otp/verifyemail + code

Example register with custom fields:

{
  "email": "[email protected]",
  "password": "StrongPassword123!",
  "name": "Jane Doe",
  "customFields": {
    "company": "Acme Inc",
    "role": "Developer"
  }
}

Phone only

Available endpoints:

  • POST /auth/otp/sendphone
  • POST /auth/otp/verifyphone + code

Phone-only users receive a placeholder email internally. Use the returned token for all authenticated requests.

Example:

{ "phone": "+919876543210" }
// → verify with code
{ "phone": "+919876543210", "code": "123456" }

Both (email and phone)

Available endpoints:

  • All of the above
  • POST /auth/otp/send accepts either email or phone
// Passwordless via phone
{ "phone": "+919876543210" }
 
// Passwordless via email
{ "email": "[email protected]" }

Custom registration fields

Add custom fields in Dashboard → Auth → Custom Registration Fields. These are stored in profile_extras and returned via GET /me:

// Register
{
  "email": "[email protected]",
  "password": "password",
  "customFields": { "plan": "pro", "company": "Acme" }
}
 
// GET /me response
{
  "id": "uuid",
  "email": "[email protected]",
  "profile_extras": { "plan": "pro", "company": "Acme" }
}

Email verification

Toggle Require email verification in the dashboard. When enabled, signUp returns requiresVerification: true and no token is issued until the email is confirmed.

See Email Verification for handling this in your app.

Redirect URLs

Configure these in Dashboard → Auth → Configuration:

SettingDescription
Email Verification URLYour app’s /verify-email route — Aerostack appends ?token=...
Password Reset URLYour app’s /reset-password route — Aerostack appends ?token=...