Public Access
fix(db): remove the seeded test user from all environments
V1 inserted test@example.com / password123 everywhere, including prod. V5 deletes that row only when email and seed hash both match.
This commit is contained in:
1 parent
fe691b0558
commit
3d21bb667d
2 files changed
+11
No files matched your search
@@ -0,0 +1,5 @@
|
||||
-- V1 seeded test@example.com with the password 'password123' into every environment.
|
||||
-- The hash check makes sure only that seed row goes; user_settings follows via ON DELETE CASCADE.
|
||||
DELETE FROM users
|
||||
WHERE email = 'test@example.com'
|
||||
AND password = '$2a$10$3FApyf15qVEvFLEvl/d7aecSMZlslQdXiYlDgbOa4DfGWu4l0VCY.';
|
||||
@@ -145,4 +145,10 @@ class UserRepositoryTest extends AbstractPersistenceTest {
|
||||
|
||||
assertThrows(UserNotFoundException.class, () -> userRepository.updateSettings(-1L, null, settings));
|
||||
}
|
||||
|
||||
@Test
|
||||
void migrations_LeaveNoSeededTestUser() {
|
||||
// V1 seeded test@example.com with a known password; it must not exist after all migrations.
|
||||
assertTrue(userRepository.findByEmail("test@example.com").isEmpty());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user