#12689·zitadel

[Bug]: Login V2 resend verification code fails with "Email not changed" (COMMAND-Uch5e) when email is set but unverified

Author: JgdKdoFhrCreated Sep 3, 2026Updated Sep 30, 2026

Preflight Checklist

  • I could not find a solution in the documentation, the existing issues or discussions
  • I have joined the ZITADEL chat

Environment

Self-hosted

Version

v4.15.3

Database

PostgreSQL

Database Version

No response

Describe the problem caused by this bug

In Login V2, when a user's email is already set but not yet verified (e.g. right after self-registration), clicking "resend code" fails with [failed_precondition] Email not changed (COMMAND-Uch5e). No new code is sent, and the user has no way to self-service a resend.

This appears to happen because Login V2 implements "resend the verification code" by re-submitting the same email through zitadel.user.v2.UserService/SetEmail. The command layer correctly rejects that as a no-op ("email not changed"), but the user's actual intent — get a fresh code for the address that's already on file — has no other path to succeed in Login V2.

This looks related to #12146 ([failed_precondition] Email not changed (COMMAND-Uch5e) blocking "mark as verified" in the old Console), which was fixed in #12155 — but that fix is scoped to fix(console): ... and Login V2 is a separate frontend, so the same underlying block still reproduces there for the resend-code case.

To reproduce

  1. Self-register a new user via Login V2 (org allows self-registration).
  2. Do not verify the email immediately.
  3. Return to Login V2 later and click "resend code" / "send new code" for the unverified email.
  4. Observe the request to SetEmail fail with Email not changed (COMMAND-Uch5e), and no new email is sent.

Screenshots

No response

Expected behavior

Resending the verification code for an already-set, unverified email should succeed and issue a fresh code, without requiring the email value itself to change — the same fix applied for the "mark as verified" Console flow in #12155 seems relevant here, just needs the equivalent handling in Login V2 (or a dedicated resend-code call that doesn't route through SetEmail's unchanged-value guard).

Operating System

No response

Relevant Configuration

No response

Additional Context

Log excerpt (redacted), confirming the failing call and its full error detail:

bash
time=2026-09-02T13:01:16.989Z level=WARN msg="Email not changed (COMMAND-Uch5e)" \
  version=v4.15.3 err.kind=PreconditionFailed err.message="Email not changed" err.id=COMMAND-Uch5e

time="2026-09-02T13:01:16Z" level=info msg=activity grpcStatus=9 httpStatus=400 \
  method=/zitadel.user.v2.UserService/SetEmail trigger=resourceAPI