Sha256: 233ca311ab6b722905325bc09626124a252c3f1a4bc550bfd76ea6935f4820f2
Contents?: true
Size: 651 Bytes
Versions: 6
Compression:
Stored size: 651 Bytes
Contents
class User < ActiveRecord::Base # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :confirmable serialize :tokens, JSON def valid_token?(client_id, token) return false unless self.tokens[client_id]['expiry'] > 2.weeks.ago return false unless BCrypt::Password.new(self.tokens[client_id]['token']) == token return true end def serializable_hash(options={}) options ||= {} options[:except] ||= [:tokens] super(options) end end
Version data entries
6 entries across 6 versions & 1 rubygems