¿Cómo agregar la confirmación del usuario en la autenticación desde el correo? [cerrado]
Frecuentes
Visto 97 veces
0
I have authentication process but it saves the user when sign up and login can be done once sign up is completed. I want to send a mail to the user to conform the account, only then he must be able to login. How can i add this feature in my existing authentication system?
1 Respuestas
1
There is a pretty good gem that helps you with user authentication workflows. Devise can be found here: http://rubygems.org/gems/devise
But if you want to develop your own authentication system, you need to save the user on the database, and use a column for to manage the registration state (e.g. registered / confirmed).
To send e-mails to the user, please take a look at the action mailer documentation page: http://guides.rubyonrails.org/action_mailer_basics.html
Respondido 24 ago 12, 10:08
I tried devise example and i worked fine but i could not able to change the views so i tried another way from railscasts.com/episodes/250-authentication-from-scratch which went well, but missing account confirmation from mail. - usr
You can override the devise views. The documentation could be better in that part, but it can be done. Look at the devise source code and create the same views' structure in your app. Copy the views in the gem to your app/views/devise/... and edit them in place. Rails will use the views you define instead of the views in the gem. Source code can be found here: github.com/plataformatec/dispositivo - tiago franco
I could not find where to change the views in the github.com/plataformatec/devise/wiki/Example-Applications. Please look at this example. - usr
Right. The documentation is not the best on that part. If you look at the gem source, it has the views in there. Including the mail views. See github.com/plataformatec/devise/tree/master/app/views/devise/…. Just copy the respective file to your app, overriding the full directory. For example, copy app/views/devise/mailer/confirmation_instructions.html.erb from the gem to your local app/views/devise/mailer/confirmation_instructions.html.erb. Then edit the file to your own needs. That should work. - tiago franco
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas ruby-on-rails ruby-on-rails-3 or haz tu propia pregunta.
I did not use any gem. I just followed this link railscasts.com/episodios/250-authentication-from-scratch and made an authentication system. - usr