lib/classmate/user.rb
def decrypt(config, encrypted_params)
        key = Digest::MD5.hexdigest("secret_key_#{config.secret_key}")

        encryptor = ActiveSupport::MessageEncryptor.new(key)

        encryptor.decrypt_and_verify(encrypted_params)
      rescue ActiveSupport::MessageEncryptor::InvalidMessage, ActiveSupport::MessageVerifier::InvalidSignature
        ::Rails.logger.error "\nError while decoding classmate params: \"#{ encrypted_params }\""

        nil
      end
# Creates an instance of Classmate::User using application config and request parameters
Creates an instance of Classmate::User using application config and request parameters
Creates an instance of Classmate :: User using application config and request parameters
def decrypt(config, encrypted_params)
        key = Digest::MD5.hexdigest("secret_key_#{config.secret_key}")
        encryptor = ActiveSupport::MessageEncryptor.new(key)
        encryptor.decrypt_and_verify(encrypted_params)
      rescue ActiveSupport::MessageEncryptor::InvalidMessage, ActiveSupport::MessageVerifier::InvalidSignature
        ::Rails.logger.error "\nError while decoding classmate params: \"#{ encrypted_params }\""
        nil
      end
def decrypt ( config , encrypted_params ) key = Digest :: MD5 . hexdigest ( "secret_key_#{config.secret_key}" ) encryptor = ActiveSupport :: MessageEncryptor . new ( key ) encryptor . decrypt_and_verify ( encrypted_params ) rescue ActiveSupport :: MessageEncryptor :: InvalidMessage , ActiveSupport :: MessageVerifier :: InvalidSignature :: Rails . logger . error "\nError while decoding classmate params: \"#{ encrypted_params }\"" nil end
Creates an instance of Classmate::User using application config and request parameters
Creates an instance of Classmate :: User using application config and request parameters
config
encrypted_params