heapsource / active_model_otp

Adds methods to set and authenticate against one time passwords (Two-Factor Authentication). Inspired in AM::SecurePassword
MIT License
769 stars 81 forks source link

Avoid overriding predefined otp_column value when initializing resource #10

Closed ilanstern closed 10 years ago

ilanstern commented 10 years ago

Currently there is no way of predefining a value for the otp_column as it is being overridden by the before_create callback.

Use case: admin user that creates other users, can only have access to the code when creating those users. If the code is generated on an after_create callback, it has to be visible on other views (besides resource.new) in order to have access to the code.

NOTE: Did not know if gem should add attr_accessible for otp_column by default or if it has to be added manually on the resource with has_one_time_password.