Skip to content

Commit 9c6ed7a

Browse files
committed
update README, authy was deprecated a while ago, moving the migration
strategy instructions below intro
1 parent 1f1b885 commit 9c6ed7a

File tree

1 file changed

+45
-45
lines changed

1 file changed

+45
-45
lines changed

README.md

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,3 @@
1-
# Migrate Authy to Twilio Verify API (for SMS and TOTP 2FA)
2-
3-
### This gem is meant to be a drop-in replacement for devise-authy in a Rails app (minus the following features)
4-
- Currently only support mobile phones with US country codes
5-
- Removed Onetouch support
6-
- Removed ability to request a phone call
7-
8-
### Just follow the steps below to migrate:
9-
- Swap out `devise-authy` in your Gemfile with `devise-twilio-verify`
10-
- `gem 'devise-twilio-verify'
11-
- Setup a Twilio Verify account
12-
- Add env vars and/or Rails credentials for:
13-
- `TWILIO_AUTH_TOKEN`
14-
- `TWILIO_ACCOUNT_SID`
15-
- `TWILIO_VERIFY_SERVICE_SID`
16-
- Create/run a migration to rename and add the following columns
17-
```ruby
18-
class MigrateAuthyToTwilioVerify < ActiveRecord::Migration[6.1]
19-
def change
20-
rename_column :users, :authy_sms, :twilio_verify_sms
21-
rename_column :users, :authy_enabled, :twilio_verify_enabled
22-
rename_column :users, :last_sign_in_with_authy, :last_sign_in_with_twilio_verify
23-
add_column :users, :twilio_totp_factor_sid, :string
24-
end
25-
end
26-
27-
```
28-
- you can also delete the `users.authy_id` column if you choose
29-
- Twilio Verify service sms will be sent to `users.mobile_phone`, so make sure you store the users 2fa phone number in this column, can make this field name dynamic in the future
30-
- Do a project code wide search & replace of these terms
31-
- `devise-authy` -> `devise-twilio-verify`
32-
- `authy_` -> `twilio_verify_`
33-
- `_authy` -> `_twilio_verify`
34-
- `authy-` -> `twilio-verify-`
35-
- `-authy` -> `-twilio-verify`
36-
- `Authy` -> `TwilioVerify`
37-
- Do a project file search & replace of any file with authy in the name (here's a few examples to replace)
38-
- app/javascript/src/deviseTwilioVerify.js
39-
- app/assets/stylesheets/devise_twilio_verify.scss
40-
- config/locales/devise.twilio_verify.en.yml
41-
421
# Twilio Verify Devise [![Build Status](https://github.com/jayywolff/twilio-verify-devise/workflows/build/badge.svg)](https://github.com/jayywolff/twilio-verify-devise/actions)
432

443
This is a [Devise](https://github.com/heartcombo/devise) extension to add [Two-Factor Authentication with Twilio Verify](https://www.twilio.com/docs/verify) to your Rails application.
@@ -48,10 +7,9 @@ Please visit the Twilio Docs for more information:
487
* [Verify + Ruby (Rails) quickstart](https://www.twilio.com/docs/verify/quickstarts/ruby-rails)
498
* [Twilio Ruby helper library](https://www.twilio.com/docs/libraries/ruby)
509
* [Verify API reference](https://www.twilio.com/docs/verify/api)
51-
52-
10+
* [Migrate Authy to Twilio Verify API](#migrate-authy-to-twilio-verify-api)
5311
* [Pre-requisites](#pre-requisites)
54-
* [Demo](#demo)
12+
* [Demo (TODO)](#demo)
5513
* [Getting started](#getting-started)
5614
* [Configuring Models](#configuring-models)
5715
* [With the generator](#with-the-generator)
@@ -246,7 +204,7 @@ This will display a QR code on the verification screen (you still need to take a
246204

247205
In Rails 5 `protect_from_forgery` is no longer prepended to the `before_action` chain. If you call `authenticate_user` before `protect_from_forgery` your request will result in a "Can't verify CSRF token authenticity" error.
248206

249-
To remedy this, add `prepend: true` to your `protect_from_forgery` call, like in this example from the [Twilio Verify Devise demo app](https://github.com/twilio/authy-devise-demo):
207+
To remedy this, add `prepend: true` to your `protect_from_forgery` call
250208

251209
```ruby
252210
class ApplicationController < ActionController::Base
@@ -262,5 +220,47 @@ Run the following command:
262220
$ bundle exec rspec
263221
```
264222

223+
## Migrate Authy to Twilio Verify API
224+
225+
### This gem is meant to be a drop-in replacement for devise-authy in a Rails app (minus the following features)
226+
- Currently supports SMS and TOTP 2FA
227+
- Currently only support mobile phones with US country codes
228+
- Removed Onetouch support
229+
- Removed ability to request a phone call
230+
231+
### Just follow the steps below to migrate:
232+
- Swap out `devise-authy` in your Gemfile with `devise-twilio-verify`
233+
- `gem 'devise-twilio-verify'
234+
- Setup a Twilio Verify account
235+
- Add env vars and/or Rails credentials for:
236+
- `TWILIO_AUTH_TOKEN`
237+
- `TWILIO_ACCOUNT_SID`
238+
- `TWILIO_VERIFY_SERVICE_SID`
239+
- Create/run a migration to rename and add the following columns
240+
```ruby
241+
class MigrateAuthyToTwilioVerify < ActiveRecord::Migration[6.1]
242+
def change
243+
rename_column :users, :authy_sms, :twilio_verify_sms
244+
rename_column :users, :authy_enabled, :twilio_verify_enabled
245+
rename_column :users, :last_sign_in_with_authy, :last_sign_in_with_twilio_verify
246+
add_column :users, :twilio_totp_factor_sid, :string
247+
end
248+
end
249+
250+
```
251+
- you can also delete the `users.authy_id` column if you choose
252+
- Twilio Verify service sms will be sent to `users.mobile_phone`, so make sure you store the users 2fa phone number in this column, can make this field name dynamic in the future
253+
- Do a project code wide search & replace of these terms
254+
- `devise-authy` -> `devise-twilio-verify`
255+
- `authy_` -> `twilio_verify_`
256+
- `_authy` -> `_twilio_verify`
257+
- `authy-` -> `twilio-verify-`
258+
- `-authy` -> `-twilio-verify`
259+
- `Authy` -> `TwilioVerify`
260+
- Do a project file search & replace of any file with authy in the name (here's a few examples to replace)
261+
- app/javascript/src/deviseTwilioVerify.js
262+
- app/assets/stylesheets/devise_twilio_verify.scss
263+
- config/locales/devise.twilio_verify.en.yml
264+
265265
## Copyright
266266
See LICENSE.txt for further details.

0 commit comments

Comments
 (0)