16 of 20 rust services had no PORT env var set; their main.rs calls
std::env::var('PORT').expect('PORT must be a valid u16') which panicked
on startup. This commit adds env.PORT matching the existing containerPort
for each service. Service ports: gateway=9100 users=9101 companies=9102
jobs=9103 job_seekers=9104 customers=9105 employees=9106 photographers=9107
tutors=9108 makeup_artists=9109 developers=9110 video_editors=9111
graphic_designers=9112 social_media_managers=9113 fitness_trainers=9114
catering_services=9115 payments=9116 ugc_content_creators=9117 leads=9118
4 KiB
OTP Issue Fix for NXTGAUGE Signup Flow
Problem Statement
Users get "unable to create account" error when trying to sign up in the frontend-solid application. The OTP (One-Time Password) verification functionality during signup is broken.
Root Cause Analysis
The OTP fixes were implemented but got overwritten by subsequent commits and finally all services were switched to high-performance-latest tag which doesn't include the OTP functionality.
Historical Context
April 16, 17:30 - Initial OTP Fixes (Working)
- Frontend commit:
152f918- Fixed resend-otp API endpoint path - Backend users commit:
31d4570- Updated email footer - These fixes made OTP work correctly
April 16, 18:06 - v1 API + Legacy OTP Support (Enhanced)
- Gateway commit:
d084491- Added /api/v1/users routing + legacy resend-otp endpoint for backward compatibility - Backend users commit:
d084491- Updated to support v1 API - Enhanced OTP support with backward compatibility
April 16, 21:33 - Infrastructure Override (Broke OTP)
- Frontend:
152f918→d26f0bf(lost OTP fix) - Backend users:
d084491→9444056(lost v1 API/OTP support) - These crane mirror builds overwrote the OTP fixes
April 17, 05:25 - Current State (Still Broken)
- All services switched to
high-performance-latesttag - Frontend:
high-performance-latest(missing OTP fix from152f918) - Gateway:
high-performance-latest(missing legacy OTP support fromd084491) - Backend users:
high-performance-latest(missing v1 API/OTP fromd084491)
Current GitOps Configuration
Backend Kustomization (apps/nxtgauge-backend-rust/overlays/prod/kustomization.yaml)
images:
- name: registry.nxtgauge.com/nxtgauge-rust-gateway
newTag: high-performance-latest
- name: registry.nxtgauge.com/nxtgauge-rust-users
newTag: high-performance-latest
- name: registry.nxtgauge-frontend-solid
newTag: high-performance-latest
Frontend Kustomization (apps/nxtgauge-frontend-solid/overlays/prod/kustomization.yaml)
images:
- name: registry.nxtgauge.com/nxtgauge-frontend-solid
newTag: high-performance-latest
Required Fix
Option 1: Revert to Known Working Commits (Recommended)
Update the kustomization files to use the specific commits that included the OTP fixes:
- Frontend: Change back to
152f918(contains the OTP endpoint fix) - Gateway: Change back to
d084491(contains legacy OTP support) - Backend users: Change back to
d084491(contains v1 API + OTP support)
Option 2: Fix high-performance-latest Branch
If there's a high-performance-latest branch in the respective repositories, ensure the OTP fixes from commits 152f918 and d084491 are merged/rebased into it.
Files to Modify
apps/nxtgauge-frontend-solid/overlays/prod/kustomization.yamlapps/nxtgauge-backend-rust/overlays/prod/kustomization.yaml
Expected Behavior After Fix
- User enters email during signup
- Frontend calls OTP generation endpoint
- Backend generates and sends OTP via email
- User enters received OTP
- Frontend calls OTP verification endpoint
- Backend verifies OTP and creates account
- User successfully signs up without "unable to create account" error
Verification Steps
After applying the fix:
- Trigger ArgoCD sync for both applications
- Wait for pods to restart with new images
- Test signup flow: enter email → receive OTP → verify OTP → account created
- Check logs if signup still fails
- Verify OTP resend functionality works
Additional Context
SMTP Configuration (from secret.yaml)
- SMTP_HOST: "smtp.zeptomail.in"
- SMTP_PORT: "587"
- SMTP_FROM_EMAIL: "support@nxtgauge.com"
- SMTP_SECURE: "false"
Gateway Configuration
- Gateway URL: "http://nxtgauge-rust-gateway:9100"
- API URL: "http://nxtgauge-rust-gateway:9100/api"
- Users Service URL: "http://nxtgauge-rust-users:9101"
Please analyze the codebase, identify the exact OTP endpoints that need to work, and provide the necessary fixes to restore the signup functionality.