Sha256: 2c9fed85d49c1eae55fb6a451372741966d6e75f2bd47f301ef4d5fc95aa6ffa
Contents?: true
Size: 665 Bytes
Versions: 12
Compression:
Stored size: 665 Bytes
Contents
# frozen_string_literal: true require 'active_support' module DHS module Interceptors module AutoOauth extend ActiveSupport::Concern class Interceptor < DHC::Interceptor def before_request request.options[:auth] = { bearer: token } end def tokens @tokens ||= DHS::Interceptors::AutoOauth::ThreadRegistry.access_token end def token if tokens.is_a?(Hash) tokens.dig( request.options[:oauth] || request.options[:record]&.auto_oauth ) else tokens end end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems