def acts_as_google_authenticated(options = {})
@google_label_column = options[:column_name] || :email
@google_label_method = options[:method] || :default_google_label_method
@google_secret_column = options[:google_secret_column] || :google_secret
@google_lookup_token = options[:lookup_token] || :persistence_token
@google_drift = options[:drift] || GoogleAuthenticatorRails::DRIFT
@google_issuer = options[:issuer]
@google_qr_size = options[:qr_size] || '200x200'
@google_secrets_encrypted = !!options[:encrypt_secrets]
if @google_secrets_encrypted && !GoogleAuthenticatorRails.encryption_supported?
msg = "Google secret encryption is only supported on Ruby on Rails 4.1 and above. Encryption has been disabled for #{name}."
if defined?(Rails) && !Rails.env.test?
Rails.logger.warn msg
else
puts msg
end
@google_secrets_encrypted = false
end
puts ":skip_attr_accessible is no longer required. Called from #{Kernel.caller[0]}}" if options.has_key?(:skip_attr_accessible)
[:google_label_column, :google_label_method, :google_secret_column, :google_lookup_token, :google_drift, :google_issuer, :google_qr_size, :google_secrets_encrypted].each do |cattr|
self.singleton_class.class_eval { attr_reader cattr }
end
include GoogleAuthenticatorRails::ActiveRecord::Helpers
end