/**
 * Development-Only OTP Retrieval Endpoint
 *
 * OTP storage has been migrated from Redis to Convex.
 * Plaintext OTPs are no longer stored. In development, OTP codes
 * are logged to the console when generated.
 *
 * Use the development bypass code "000000" in verifyOTP for testing.
 */

import { NextResponse } from "next/server";

export const dynamic = "force-dynamic";
export const runtime = "nodejs";

export async function POST() {
  // SECURITY: Only allow in development mode
  if (process.env.NODE_ENV === "production") {
    return NextResponse.json(
      { error: "This endpoint is not available in production" },
      { status: 403 },
    );
  }

  return NextResponse.json({
    message:
      "OTP storage migrated to Convex. Plaintext OTPs are no longer stored in Redis.",
    hint: 'Check the server console for OTP codes, or use bypass code "000000" in development.',
  });
}
