Skip to content

Comments

fix: Set default status to 'pending' for verification codes#191

Merged
roncodes merged 1 commit intodev-v1.6.36from
fix/verification-code-default-status
Feb 24, 2026
Merged

fix: Set default status to 'pending' for verification codes#191
roncodes merged 1 commit intodev-v1.6.36from
fix/verification-code-default-status

Conversation

@roncodes
Copy link
Member

Problem

The VerificationCode model was creating records with NULL status because the generateFor() method never initialized the status field.

This caused issues when querying for verification codes with:

->where('status', 'pending')

All queries would fail to find the verification code, resulting in "Invalid or expired verification code" errors even with valid codes.

Solution

Set status = 'pending' by default in the generateFor() method, which is called by both generateEmailVerificationFor() and generateSmsVerificationFor().

Changes

  • Added $verifyCode->status = 'pending'; in generateFor() method
  • All verification codes now have proper status from creation

Impact

Fixes verification flow for:

  • Email verification codes
  • SMS verification codes
  • Registry developer account verification
  • Any other code using the VerificationCode model

Testing

After this fix, verification codes will be created with status = 'pending' and can be properly queried and validated.

The VerificationCode model was creating records with NULL status because
the generateFor() method never initialized the status field.

This caused issues when querying for verification codes with:
  ->where('status', 'pending')

Now all verification codes are created with status = 'pending' by default,
which is the expected behavior for newly generated codes.

Fixes verification flow for email and SMS verification codes.
@roncodes roncodes changed the base branch from main to dev-v1.6.36 February 24, 2026 02:14
@roncodes roncodes merged commit e8a9152 into dev-v1.6.36 Feb 24, 2026
3 checks passed
@roncodes roncodes deleted the fix/verification-code-default-status branch February 24, 2026 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant