two_factor_authentication icon indicating copy to clipboard operation
two_factor_authentication copied to clipboard

Do we need uniqueness index for encrypted_otp_secret_key?

Open airled opened this issue 3 years ago • 0 comments

The gem automatically creates migration file with this index:

...
add_index :users, :encrypted_otp_secret_key, unique: true
...

It's not a big deal really. Just can't undestand why do we need it? Even if you create several users with same otp_secret_key, the salt and iv most likely be different for both of the users. So encrypted_otp_secret_key field will be different too. Seems like the index is pretty pointless. What do you think?

airled avatar Feb 08 '22 16:02 airled