Skip to content

[Bug] Signup route calls referral helpers that are never imported #713

Description

@RUKAYAT-CODER

Overview

src/app/api/auth/signup/route.ts calls validateReferralCode(), referralCodeExists(), and getReferralCodeOwner() but none of these functions appear in the file's import statements. Node.js throws ReferenceError at the point these are invoked, breaking signup for any user who provides a referral code.

Specifications

Features:

  • Referral code validation works end-to-end without runtime errors

Tasks:

  • Add import { validateReferralCode, referralCodeExists, getReferralCodeOwner } from '@/lib/referral' to the route file
  • Verify each imported function exists and is exported from src/lib/referral.ts
  • Add a test covering the full signup path when a valid referral code is provided

Impacted Files:

  • src/app/api/auth/signup/route.ts
  • src/lib/referral.ts

Acceptance Criteria

  • Signup with a referral code completes without a ReferenceError
  • All three referral helpers are imported and resolve correctly
  • TypeScript compilation succeeds with no missing-module errors

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions