Prevent banned users from verifying email with a surviving session #985
Labels
No labels
automated
code-quality
component: admin dashboard
component: backend
component: billing
component: content management
component: faqs
component: game genres
component: game lists
component: game reviews
component: game search
component: games
component: internal notifications
component: platforms
component: security
component: tests
component: user api
component: user badges
component: user blogs
component: user consoles
component: user favorites
component: user friends
component: user notifications
component: user profiles
component: user site notifications
component: user wishlists
component: web design
dependencies
javascript
php
priority
high
priority
low
priority
medium
security-hotspot
source: codex
source: sonarqube
status
awaiting feedback
status
backlog
status
done
status
in progress
status
in queue
status
in review
status
needs codex review
status
needs investigation
status
wontfix
type: bug
type: documentation
type: feature
type: improvement
type: regression
type: task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MyVideoGameList/myvideogamelist.com#985
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Banned users must be prevented from activating their accounts through an email verification link, even if they retain a valid authenticated session.
Registration automatically logs the new user in before email verification. Normal bans invalidate database sessions and block subsequent login, but Fortify's verification endpoint previously checked only authentication, the signed URL, and the matching account/email hash. A surviving session could therefore verify the email after a ban. Verification does not remove the ban, but the activation action should still be denied.
Acceptance criteria
banned = Y, the banned role ID, or both, even with a valid session and signed link.email_verified_atunset and do not dispatch theVerifiedevent for denied attempts.Implementation and verification
The fix is implemented through
App\Http\Requests\VerifyEmailRequest, bound to Fortify's verification request inFortifyServiceProvider::register(). It retains Fortify's existing account and email hash checks and adds the sharedUser::isBanned()check. Existing authentication, signed-URL validation, and throttling remain in place.Regression coverage reproduces a surviving authenticated session for all three ban-marker combinations. The original ban regression tests failed before the fix and pass afterward.
Acceptance re-review — October 19, 2026
Verifiedevent, and retained ban for the ban flag, banned role, and both markers.Verified.Verifiedevent.Verifiedevent.git diff --check: passed.No frontend assets, migrations, or dependencies changed. PR #986 lint and MariaDB CI checks passed (tasks #1316 and #1317).
Release tracking
6ba1f60, non-draft PR #986, assigned tojimmyb.d2d51d017c49efa767a9d67438d25eadacfccce6.d2d51d017c49efa767a9d67438d25eadacfccce6; deployed file hashes/autoload, release manifests, external HTTP health, and guest activation-route checks passed. Ban-specific regression coverage passed without modifying live accounts.Implementation, acceptance review, PR CI, merge, and dev/production deployment are complete. This issue is closed with status/done; see the deployment comment for verification details and rollback backups. Post-merge push workflows were still running at the final check.
Merged via PR #986 by jimmyb as
d2d51d017c49efa767a9d67438d25eadacfccce6; local master has been fast-forwarded to the merge commit.Implementation notes:
User::isBanned()predicate before Fortify's existing account/email-hash authorization. Both the ban flag and banned role are covered.Verifiedevent is emitted, and the ban remains intact.Validation: 43 focused tests / 217 assertions, Pint, PHPStan, and whitespace checks passed locally. PR lint and MariaDB CI tasks #1316 and #1317 succeeded. No migrations, dependency changes, or frontend rebuild are required.
Dev and production deployment follows this closeout. The deployment checkbox will be marked complete after both targets are verified, with rollback locations recorded in a follow-up comment.
Deployed merged master revision
d2d51d017c49efa767a9d67438d25eadacfccce6to dev, verified it, then deployed and verified production.app/Http/Requests/VerifyEmailRequest.phpandapp/Providers/FortifyServiceProvider.php, directly from the merged commit./up;/email/verify/0/invalidreturned 302 to each environment's own login page. Requests originating on the web server redirected dev traffic to the production homepage; independent external checks confirmed dev itself responds correctly.Rollback backups:
/home/mvgldev/deploy-backups/issue985-d2d51d01-tv7zixir/home/mvgl/deploy-backups/issue985-d2d51d01-y3nusqdcEach backup preserves the previous provider and release manifest. To roll back this patch, restore those and remove the newly added verification request. Deployment receipts and artifacts are under each account's
releases/issue985-d2d51d01directory.All acceptance, review, and release checklist items are now complete. Issue #985 is closed with
status/done.