fix: sync harden auth, privacy, and PTS state

This commit is contained in:
iamxvbaba 2026-08-02 14:12:04 +08:00
parent c1597696af
commit 2512eab51d
24 changed files with 817 additions and 154 deletions

View file

@ -15,6 +15,22 @@ func TestPasswordErrMapsOccupiedLoginEmailToNotAllowed(t *testing.T) {
}
}
func TestPasswordErrMapsRecoveryState(t *testing.T) {
tests := []struct {
err error
want string
}{
{domain.ErrRecoveryCodeEmpty, "CODE_EMPTY"},
{domain.ErrRecoveryCodeInvalid, "CODE_INVALID"},
{domain.ErrPasswordRecoveryExpired, "PASSWORD_RECOVERY_EXPIRED"},
}
for _, tc := range tests {
if err := passwordErr(tc.err); !tgerr.Is(err, tc.want) {
t.Fatalf("passwordErr(%v)=%v, want %s", tc.err, err, tc.want)
}
}
}
func TestBindTempAuthKeyErrPreservesRecoverableRotationErrors(t *testing.T) {
tests := []struct {
err error