Skip to content

cleanup: remove dead verification_token table and operations #39

Description

@aspiers

Problem

The verification_token table (packages/shared/src/db.ts:77-88) and its associated operations (createVerificationToken, getVerificationToken, markVerificationTokenUsed, incrementTokenAttempts, cleanupExpiredTokens, getVerificationTokenByCsrf) were part of the original custom OTP implementation.

This has been superseded by better-auth's emailOTP plugin, which uses its own verification table. No auth-service route code calls createVerificationToken or getVerificationToken anymore.

The cleanup timer in context.ts still runs cleanupExpiredTokens() on an empty table every 5 minutes.

Proposed Fix

  1. Remove the verification_token table creation from the schema (or add a migration that drops it).
  2. Remove the associated DB methods from EpdsDb.
  3. Remove the cleanup timer call for cleanupExpiredTokens() (if it still exists).

Severity

Low — dead code increases audit surface but has no runtime impact.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions