DEF-001 — Verification code error¶
Summary¶
User clicks "verify" when inputting valid verification code and gets an error on screen.
Environment¶
- App:
melodex.io - Commit (SHA):
a0dad94 - Browser:
Firefox 142.0.1 (Desktop) - Device:
Windows 11 Desktop - Network:
Spectrum (approx 450 up / 11 down) - Date:
09-09-2025
Triage¶
- Severity:
Major - Priority:
Medium
Preconditions¶
- One account can authenticate (Email and/or Google) and reach
/rank. - Email and password ready for registration process.
Steps to Reproduce¶
- Prepare email that has no account linked, test username, and password
- Go to create account and enter the email, test username, and password
- Open email and get verification code
- Enter verification code and click "Verify"
Expected Result¶
After clicking "verify", the account is activated, the user is authenticated, page the redirects to /rank.
Actual Result¶
Verification code is accepted, but a TypeError (_ is not a function) appears under “Back to Login” and no automatic redirect occurs.
Impact¶
Confuses the user and interrupts onboarding; user may think the verification failed. Requires manual navigation to continue, reducing trust in the flow.
Attachments¶
- Screenshots: DEF-001-1 DEF-001-2
- Console logs: DEF-001-console-1 DEF-001-console-2
Diagnostics¶
- Registering with other account details
- Clicking register again, which leads to DEF-001-2 and DEF-001-console-2
- Refreshing the page, which succesfully loads authenticated /rank state
Suspected Areas¶
- Register.jsx → handleVerify() after Auth.signIn, and any code called by checkUser()
Owner: Michael DeReus
Status: Resolved
Opened: 2025-09-09
Closed: 2025-12-09
Linked Items¶
- Risk:
R-01(Onboarding/auth failures) - Test:
SMK-00(in baseline)
Fix Reference¶
- Commit:
6c12626 - PR:
#2- fix: DEF-001
Root Cause¶
The UserContext provider did not expose setter functions (setUserID, setDisplayName, setProfilePicture). During the post-verification path in Register.jsx → handleVerify(), the component called these setters, causing TypeError: setUserID is not a function. This blocked the redirect to /rank despite a successful confirmSignUp + signIn.
Changes¶
- Fixed verification flow to handle code submission without throwing
_ is not a function. - Ensured successful verification redirects user to
/rank.
Verification Steps¶
- Followed the original repro steps:
- Register with email/password.
- Enter verification code and press Verify.
- Observed post-fix behavior:
- User auto-signed in (Cognito session created).
- Redirected to /rank without error.
- Navbar/avatar render with expected profile picture.
- Session checks:
- Reloaded /rank → remained authenticated (no redirect loop).
- Signed out → routed to /login; signed back in successfully.
Evidence¶
- Screenshot/GIF: DEF-001-verify.png DEF-001-verify-rank.png
- Console log: DEF-001-verify-console
Verified in: a0dad94 on 2025-12-09
Verification Status: Pass