Sha256: 6fb5f68c1adc472e1927c7fbc10700c9480cf76e4bbd73b300551b917062162f

Contents?: true

Size: 345 Bytes

Versions: 39

Compression:

Stored size: 345 Bytes

Contents

class JefferiesTube::AccessToken
  def self.create(hash)
    verifier.generate(hash.to_yaml)
  end

  def self.read(token)
    YAML.load(verifier.verify token)
  rescue ActiveSupport::MessageVerifier::InvalidSignature
    {}
  end

  private

  def self.verifier
    ActiveSupport::MessageVerifier.new(Rails.configuration.secret_token)
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
jefferies_tube-1.7.1 lib/jefferies_tube/access_token.rb
jefferies_tube-1.7.0 lib/jefferies_tube/access_token.rb
jefferies_tube-1.6.9 lib/jefferies_tube/access_token.rb
jefferies_tube-1.6.8 lib/jefferies_tube/access_token.rb
jefferies_tube-1.6.7 lib/jefferies_tube/access_token.rb
jefferies_tube-1.6.6 lib/jefferies_tube/access_token.rb
jefferies_tube-1.6.5 lib/jefferies_tube/access_token.rb
jefferies_tube-1.6.4 lib/jefferies_tube/access_token.rb
jefferies_tube-1.6.3.2 lib/jefferies_tube/access_token.rb
jefferies_tube-1.6.3.1 lib/jefferies_tube/access_token.rb
jefferies_tube-1.6.3 lib/jefferies_tube/access_token.rb
jefferies_tube-1.6.2 lib/jefferies_tube/access_token.rb
jefferies_tube-1.6.1 lib/jefferies_tube/access_token.rb
jefferies_tube-1.6.0 lib/jefferies_tube/access_token.rb
jefferies_tube-1.5.4 lib/jefferies_tube/access_token.rb
jefferies_tube-1.5.3 lib/jefferies_tube/access_token.rb
jefferies_tube-1.5.2 lib/jefferies_tube/access_token.rb
jefferies_tube-1.5 lib/jefferies_tube/access_token.rb
jefferies_tube-1.4 lib/jefferies_tube/access_token.rb
jefferies_tube-1.3 lib/jefferies_tube/access_token.rb