Ok - this time add the new controllers we stripped out of inline and add back the csp
This commit is contained in:
13
db/migrate/20251104061455_clear_existing_backup_codes.rb
Normal file
13
db/migrate/20251104061455_clear_existing_backup_codes.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class ClearExistingBackupCodes < ActiveRecord::Migration[8.1]
|
||||
def up
|
||||
# Clear all existing backup codes to force regeneration with BCrypt hashing
|
||||
# This is a security migration to move from plain text to hashed storage
|
||||
User.where.not(backup_codes: nil).update_all(backup_codes: nil)
|
||||
end
|
||||
|
||||
def down
|
||||
# This migration cannot be safely reversed
|
||||
# as the original plain text codes cannot be recovered
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user