![](/img/trans.png)
[英]Rails 4 error with twitter/Facebook authentication. Devise
[英]Rails devise email authentication error
我是Rails的新手,我正在使用Rails devise模板应用程序。 当我输入电子邮件并尝试重置密码时,出现以下错误: authentication required
这是什么意思?
更新:根据trh的建议,该错误来自secrets.yml
这是当前的样子:
development:
admin_name: Ben
admin_email: admin@exmaple.com
admin_password: password
email_provider_username: "username@gmail.com" #eg. ben@gmail.com
email_provider_password: "password"
domain_name: example.com
secret_key_base: #30 digit code
错误是否可能来自我声明电子邮件提供商的用户名和密码的方式? 是否需要采用<%= ENV["GMAIL_USERNAME"] %>
?
您的邮件配置在以下位置完成: config/environments/development.rb
由于RailsApps模板已经为gmail设置了,您需要在config/secrets.yml
更改数据(用户名,密码等)。 如果您打算改用SMTP(用于非Google地址),则需要更改您的development.rb文件以匹配它。 例如,您必须更改域主机,因此,如果您的邮件提供商是outlook.com,则您的配置将类似于以下内容:
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.live.com",
:port => 587,
:enable_starttls_auto => true,
:user_name => 'noreply@example.com',
:password => 'password',
:domain => 'example.com',
:authentication => 'plain'
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.