Closed mr3abd closed 5 years ago
If you are using Authy with Devise then I can recommend you take a look at Authy-Devise as it handles a lot of this stuff for you.
Otherwise, it looks to me as though you are trying to update an attribute on your Host
model that doesn't exist. You need to create a migration to add a string field called authy_id
to your hosts table so that you can save the authy_id
from the API response in it.
Let me know how you get on with that.
I want when to make registration send the activation code to the confirmation user account
Can Authy-Devise make that, + rest password with SMS ?
This all depends. What are you try to build? The API you were using in the first post lets you implement two factor authentication in your application.
Authy doesn't handle password resets for your application. You could build that with the regular Twilio Messaging API though.
What are you trying to achieve here?
I want to build a verification for account and user can make a request to reset a password with SMS replace email
and when create the migration authy_id
authy_id be nil
If you only need phone verification for an account then you likely just need the verification API and you won't need to save an authy_id
attribute.
If you want to do password reset via SMS instead of email then you might need to dig into the Recoverable
module for Devise and replace it with one that uses Twilio's messaging API. You can check out the code samples in the docs for how to send messages, but you'll need to do a bit more research to replace Recoverable
. After a quick search I can't find anything that you can just drop in, but this is a good explanation of how you might do it without Devise.
Really thanks for your helping :1st_place_medal: ^^
my last question how to make a redirect in devise controller in sing up ?
I try to use
redirect_to phone_verifications_path
and
sign_in_and_redirect phone_verifications_path and return
not working
can help me ?
To redirect after sign up you should implement your own RegistrationsController
and override the after_sign_up_path_for
method to return the path you want to redirect to. Like
class RegistrationsController < Devise::RegistrationsController
protected
def after_sign_up_path_for(resource)
phone_verifications_path
end
end
Take a look at this wiki page in the Devise project for more detail.
Hello, when trying to use devise and write that in a controller to verify User with SMS
and I show when trying to make an account unknown attribute 'authy_id' for Host .