Comments (3)
Good point! I normally use this with the Authy App, so I don't notice that it doesn't send an SMS immediately.
We can add that as a setting, if that's something you would be interested in?
Otherwise, you can add it yourself by overriding the DeviseAuthyController
like so:
# app/controllers/devise_authy_controller.rb
class DeviseAuthyController < Devise::DeviseAuthyController
before_action :send_request, :only => :GET_verify_authy
private
def send_request
Authy::API.request_sms(:id => @resource.authy_id)
end
end
Then override the route too:
# config/routes.rb
Rails.application.routes.draw do
devise_for :users, :controllers => { :devise_authy => :devise_authy }
# other routes
end
Note that the request_sms
route sends :force => true
so that it sends an SMS even if the user normally uses the app. In the code above, it just makes a regular request which will send a push notification to the Authy app if the user uses that.
One thing I'm not sure about right now is what happens in the case where you use a third party authenticator. It may cause SMS messages to be sent, even if the user could just open their authenticator app. That would likely be worth testing.
from authy-devise.
Thank you, this works great! I think the setting would be a valuable addition, as many users know the process this way from websites like Paypal.
from authy-devise.
This library is no longer actively maintained. The Authy API has been replaced with the Twilio Verify API. Twilio will support the Authy API through November 1, 2022 for SMS/Voice. After this date, we’ll start to deprecate the service for SMS/Voice. Any requests sent to the API after May 1, 2023, will automatically receive an error. Push and TOTP will continue to be supported through July 2023.
Learn more about migrating from Authy to Verify.
Please visit the Twilio Docs for:
- Verify + Ruby (Rails) quickstart
- Twilio Ruby helper library
- Verify API reference
- Coming soon: Look out for a new Devise plugin to use Twilio Verify with Devise
Please direct any questions to Twilio Support. Thank you!
from authy-devise.
Related Issues (20)
- Installation Verification Bypassable HOT 4
- GET verify_authy_installation should redirect if authy_id is nil HOT 4
- Suggestion: Allow "soft disable" HOT 4
- ActiveRecord::RecordNotFound at /users/[object%20Object] Couldn't find User with 'id'=[object Object] after onetouch authentication HOT 11
- Push 2.0.0 release tag to GitHub HOT 1
- devise_authy.js is out of date and doesn't work HOT 2
- Option to disable 2FA without removing the User from Authy HOT 4
- Devise-Authy doesn't work with Active Admin HOT 3
- AUTHY-WITH-QR-CODE HOT 9
- POST_disable_authy action does not clear the session["#{resource_name}_authy_token_checked"] variable HOT 1
- 2.2.1 on rubygems HOT 1
- Bad decision HOT 11
- NoMethodError (undefined method `qr_code' for #<Authy::Response:0x000055948144a7d0>): HOT 2
- Use with JWT? HOT 7
- Rename last_sign_in_with_authy to last_sign_in_with_authy_at HOT 1
- POST_enable_authy redirects back to the same page HOT 2
- Is it possible to disable 2FA for another user, other than yourself (`current_user`)? HOT 3
- Verify API? HOT 2
- remember_device on logout HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from authy-devise.