开发者

How can I a make model acts_as_authentic that doesn't have the persistence_token field or related functionality?

开发者 https://www.devze.com 2023-02-01 08:42 出处:网络
I would like to use only the perishable_token feature from authlogic on this开发者_如何转开发 model and nothing else. Here\'s what I\'ve tried so far that\'s failed:

I would like to use only the perishable_token feature from authlogic on this开发者_如何转开发 model and nothing else. Here's what I've tried so far that's failed:

class EmailInvite < ActiveRecord::Base
  acts_as_authentic do |c|
    c.disable_perishable_token_maintenance = true
    c.maintain_sessions = false
  end
end

I'd appreciate any help.


Ended up just using Authlogic::Random.friendly_token to generate the token and then did everything else outside of authlogic:

class EmailInviteObserver < ActiveRecord::Observer

    def after_create(email_invite)
      email_invite.perishable_token = Authlogic::Random.friendly_token
      email_invite.save
    end

end
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号