Apps (connection/refresh_token.rb)

woofed-crm · app/models/apps/salesforce/connection/refresh_token.rb · ruby · MIT
crm, CRM / Leads

frozen_string_literal: true Mints a new access token from the stored refresh token. The work happens under a row lock because web, sidekiq and goodjob refresh independently: Salesforce keeps a limited number of active access tokens per user per app, so concurrent refreshes can ev

# Source: https://github.com/douglara/woofed-crm | License: MIT | Copyright 2026 WOOFED DESENVOLVIMENTO DE SOFTWARES LTDA - ME - CNPJ 60.076.777/0001-61
# Provided via justclaw.it.com; keep this notice with the code.
# frozen_string_literal: true

# Mints a new access token from the stored refresh token.
#
# The work happens under a row lock because web, sidekiq and goodjob refresh
# independently: Salesforce keeps a limited number of active access tokens per
# user per app, so concurrent refreshes can evict a token another process is
# still using.
class Apps::Salesforce::Connection::RefreshToken
  def initialize(salesforce, force: false)
    @salesforce = salesforce
    @force = force
  end

  def call
    return { error: I18n.t('apps.salesforce.oauth_errors.missing_refresh_token') } if 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key