我有authlogic使用gaizka的authlogic_openid版本,我發現在Github上自動註冊,因爲pelle的原始添加功能似乎會導致問題。authlogic auto_register功能使用我的選項
http://github.com/gaizka/authlogic_openid
using authlogic to auto create users bypassing explicit user registeration
使用auto_register功能,它忽略了我的authlogic選項,例如從OpenID提供檢索電子郵件時,這一個工作然而細...任何想法我在做什麼錯?
Hhere的例子:
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
你能找出合併行爲的方法嗎? – 2010-05-21 15:44:39