Procházet zdrojové kódy

Remove Encryptor; that was poorly thought-out...

old-ruby
Ben Kurtovic před 9 roky
rodič
revize
a87698d9b3
3 změnil soubory, kde provedl 0 přidání a 29 odebrání
  1. +0
    -0
     
  2. +0
    -20
      app/models/concerns/encryptor.rb
  3. +0
    -9
      app/models/user.rb

+ 0
- 0
Zobrazit soubor


+ 0
- 20
app/models/concerns/encryptor.rb Zobrazit soubor

@@ -1,20 +0,0 @@
module Encryptor
extend ActiveSupport::Concern

class_methods do
def encrypt(value)
ensure_encryptor
@crypt.encrypt_and_sign(value)
end

def decrypt(value)
ensure_encryptor
@crypt.decrypt_and_verify(value)
end

private
def ensure_encryptor
@crypt ||= ActiveSupport::MessageEncryptor.new(Rails.application.secrets.secret_key_base)
end
end
end

+ 0
- 9
app/models/user.rb Zobrazit soubor

@@ -1,17 +1,8 @@
# require 'calefaction/api/eveonline'

class User < ActiveRecord::Base
include Encryptor
has_secure_password

def api_verify
self.class.decrypt(super())
end

def api_verify=(value)
super(self.class.encrypt(value))
end

def member_of?(corp_id)
false
end


Načítá se…
Zrušit
Uložit