加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 使用我的选项的authlogic auto_register功能

发布时间:2020-12-17 02:26:22 所属栏目:百科 来源:网络整理
导读:我使用gaizka版本的authlogic_openid进行authlogic自动注册,我在 Github上发现,因为pelle原来添加的功能似乎引起了问题. http://github.com/gaizka/authlogic_openid using authlogic to auto create users bypassing explicit user registeration 这个工作
我使用gaizka版本的authlogic_openid进行authlogic自动注册,我在 Github上发现,因为pelle原来添加的功能似乎引起了问题.

http://github.com/gaizka/authlogic_openid

using authlogic to auto create users bypassing explicit user registeration

这个工作正常,但是当使用auto_register功能时,它会忽略我的authlogic选项,例如从openid提供程序检索电子邮件……任何想法我做错了什么?

有例子:

http://big-glow-mama.heroku.com/

http://github.com/holden/authlogic_openid_selector_example/tree/with-facebook/

如果您注册与登录,您可以看到差异…

#user.rb
class User < ActiveRecord::Base
  acts_as_authentic do |c| 
    c.validate_login_field = false
    # optional,but if a user registers by openid,he should at least share his email-address with the app
    c.validate_email_field = false
    # fetch email by ax
    c.openid_required_fields = [:email,"http://axschema.org/contact/email"]
    #c.required_fields = ["http://axschema.org/contact/email"]
    # fetch email by sreg
    #c.optional_fields = ["email"]
  end

  #private method to deal with emails goes here

end


#UserSession.rb
class UserSession < Authlogic::Session::Base
  auto_register
  logout_on_timeout true
end

解决方法

This one works fine however when using the auto_register feature it ignores my options for authlogic such as retrieving the email from the openid provider… any ideas what I’m doing wrong?

处理自动注册的代码存在于authlogic_openid的Session模块中.处理注册(检索电子邮件表单提供程序等)的代码存在于ActsAsAuthentic模块中.

第一个是处理UserSession对象,后者正在处理User对象.

我将在几天后看看,看看可以做些什么来合并这两种行为.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读