1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-23 15:19:38 +02:00
Maybe/db/migrate/20250206151825_add_mfa_fields_to_users.rb
Josh Pigford 842e37658c
Multi-factor authentication (#1817)
* Initial pass

* Tests for MFA and locale cleanup

* Brakeman

* Update two-factor authentication status styling

* Update app/models/user.rb

Co-authored-by: Zach Gollwitzer <zach@maybe.co>
Signed-off-by: Josh Pigford <josh@joshpigford.com>

* Refactor MFA verification and session handling in tests

---------

Signed-off-by: Josh Pigford <josh@joshpigford.com>
Co-authored-by: Zach Gollwitzer <zach@maybe.co>
2025-02-06 14:16:53 -06:00

9 lines
358 B
Ruby

class AddMfaFieldsToUsers < ActiveRecord::Migration[7.2]
def change
add_column :users, :otp_secret, :string
add_column :users, :otp_required, :boolean, default: false, null: false
add_column :users, :otp_backup_codes, :string, array: true, default: []
add_index :users, :otp_secret, unique: true, where: "otp_secret IS NOT NULL"
end
end