Protect Driver accounts with safe password reset links - #412
Open
OziinG wants to merge 1 commit into
Open
Conversation
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
OziinG
force-pushed
the
codex/driver-password-reset
branch
from
September 10, 2026 07:27
fded3b4 to
a042feb
Compare
Constraint: Driver resets must preserve driver, route, and vehicle relationships and cannot use unverified identity fields. Rejected: Name and phone reset | It does not prove control of the account. Confidence: high Scope-risk: moderate Directive: Keep DriverAccount reset persistence separate from CustomerAccount invitations. Tested: Prisma generate and validate; full lint, typecheck, tests, build; disposable PostgreSQL migration, concurrency, lockout, and session invalidation integration. Not-tested: SMS delivery and production deployment were intentionally not run.
OziinG
force-pushed
the
codex/driver-password-reset
branch
from
September 10, 2026 07:31
a042feb to
1fef948
Compare
This was referenced Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Driver operators currently have to delete and recreate an account when they forget a password, which can disable existing DSV driver and vehicle assignments. This change adds a DriverAccount-only recovery contract using administrator-issued, 30-minute one-time links while preserving every driver, route, dispatch, and vehicle relationship.
The reset token is stored only as a SHA-256 hash, older pending links are revoked, issue/validate/complete requests are limited, and public responses disclose no account identity. Completion rotates the scrypt hash and salt, clears password lockout, increments account and linked-driver token versions, revokes account and legacy driver sessions, and writes PII-redacted audit events. Login and refresh use the same account lock as reset so concurrent old credentials cannot create or revive a valid session. No SMS provider was found, so the documented contract uses
ADMIN_LINKand performs no SMS delivery.Validation:
No production deployment or real SMS was performed.