[英]Removing email activation from restful_authentication plugin
I have a Rails app handling authentication with the restful_authentication plugin. 我有一个使用restful_authentication插件处理身份验证的Rails应用程序。
I'm experiencing problems with the email activation feature and before I deal with that I would like to just allow my users to register without having to go through the email activation process. 我在使用电子邮件激活功能时遇到了问题,在处理该问题之前,我想只允许我的用户注册,而不必执行电子邮件激活过程。
How do I disable the email activation feature. 如何禁用电子邮件激活功能。
Rails 2.2.3 Restful_authentication Rails 2.2.3 Restful_authentication
In app/models/user_observer.rb
, I replaced 在
app/models/user_observer.rb
,我替换了
UserMailer.deliver_signup_notification(user)
with 与
user.activate!
and it's working for me so far... 到目前为止,它对我有用...
The best solution I think is regenerating the authentication: 我认为最好的解决方案是重新生成身份验证:
Save your old code from User and Sessions (from model and controller, if you coded something in that files), destroy the authentication and regenerate it 保存用户和会话中的旧代码(如果您在模型和控制器中进行了编码,请保存在模型和控制器中),销毁身份验证并重新生成它
script/destroy authenticated user sessions
script/generate authenticated user sessions
The destroy script will delete the following files, be sure of backup it if you made any change. destroy脚本将删除以下文件,如果进行了任何更改,请确保将其备份。
rm db/migrate/20100520071407_create_users.rb
rm app/views/users/_user_bar.html.erb
rm app/views/users/new.html.erb
rm app/views/sessions/new.html.erb
rm app/helpers/users_helper.rb
rm app/helpers/sessions_helper.rb
rm test/fixtures/users.yml
rm test/unit/user_test.rb
rm test/functional/users_controller_test.rb
rm test/functional/sessions_controller_test.rb
rm config/initializers/site_keys.rb
rm lib/authenticated_test_helper.rb
rm lib/authenticated_system.rb
rm app/controllers/users_controller.rb
rm app/controllers/sessions_controller.rb
rm app/models/user.rb
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.