Browse Source

Bump version 1.1.5 -> 2.0.0

There have been a couple of recent breaking changes
so bumping the major version is required.
master
Sam Clegg 9 years ago
parent
commit
56f099da28
  1. 28
      README.md
  2. 2
      lib/two_factor_authentication/version.rb

28
README.md

@ -156,25 +156,31 @@ Below is an example using ERB:
<% end %>
<%= link_to "Sign out", destroy_user_session_path, :method => :delete %>
```
#### Enable TOTP support for existing users
#### Upgrading from version 1.X to 2.X
The following database fields are new in version 2.
- `direct_otp`
- `direct_otp_sent_at`
- `totp_timestamp`
To add them, generate a migration such as:
If you have existing users that need to be provided with a OTP secret key, so
they can use TOTP, create a rake task. It could look like this one below:
$ rails g migration AddTwoFactorFieldsToUsers direct_otp:string direct_otp_sent_at:datetime totp_timestamp:timestamp
The `otp_secret_key` is not only required for users who use Google Authentictor,
so unless it has been shared with the user it should be set to `nil`. The
following psudo-code is an example of how this might be done:
```ruby
desc 'rake task to update users with otp secret key'
task :update_users_with_otp_secret_key => :environment do
User.find_each do |user|
user.generate_totp_secret
user.save!
puts "Rake[:update_users_with_otp_secret_key] => OTP secret key set to '#{key}' for User '#{user.email}'"
User.find_each do |user| do
if !uses_authentictor_app(user)
user.otp_secret_key = nil
end
end
```
Then run the task with `bundle exec rake update_users_with_otp_secret_key`
#### Adding the TOTP encryption option to an existing app

2
lib/two_factor_authentication/version.rb

@ -1,3 +1,3 @@
module TwoFactorAuthentication
VERSION = "1.1.5".freeze
VERSION = "2.0.0".freeze
end

Loading…
Cancel
Save