Documentation
Guides
MON Authenticator Setup

MON Authenticator Setup

Complete guide to setting up TOTP 2FA with MON Authenticator.

Overview

MON Authenticator is Moontraze's TOTP app. Users scan a QR code and get 6-digit codes.

Setup Flow

Step 1: Enroll

const enroll = await moon.auth.enrollTotp();
// enroll.qrPayload = otpauth:// URL

Step 2: Show QR Code

import QRCode from 'react-qr-code';
 
<QRCode value={enroll.qrPayload} />

Step 3: User Scans

User opens MON Authenticator app and scans the QR code.

Step 4: Confirm

const code = await promptUser('Enter 6-digit code');
await moon.auth.confirmTotp(code);

QR Format

The QR code contains an otpauth:// URL:

otpauth://totp/Moontraze:user@example.com?secret=BASE32&issuer=Moontraze&period=30&digits=6

Password Reset with TOTP

Step 1: Verify TOTP

const verify = await moon.auth.forgotPasswordVerify(
  'user@example.com',
  '123456',
);

Step 2: Reset Password

await moon.auth.forgotPasswordReset(
  'user@example.com',
  verify.verifyToken,
  'newSecret123',
);

Troubleshooting

ProblemSolution
QR not scanningIncrease QR size, ensure good lighting
Code always invalidCheck device time is synced
Secret lostRe-enroll from scratch