<commit_before># frozen_string_literal: true

require 'active_support/concern'

module Devise
  module Models
    # Model that will be authenticatable with the JWT strategy
    #
    # @see [Warden::JWTAuth::Interfaces::UserRepository]
    # @see [Warden::JWTAuth::Interfaces::User]
    module JwtAuthenticatable
      extend ActiveSupport::Concern

      class_methods do
        Devise::Models.config(self, :jwt_revocation_strategy)
      end

      included do
        def self.find_for_jwt_authentication(sub)
          find_by(id: sub)
        end
      end

      def jwt_subject
        id
      end
    end
  end
end<commit_msg>find resource by primary_key<commit_after># frozen_string_literal: true

require 'active_support/concern'

module Devise
  module Models
    # Model that will be authenticatable with the JWT strategy
    #
    # @see [Warden::JWTAuth::Interfaces::UserRepository]
    # @see [Warden::JWTAuth::Interfaces::User]
    module JwtAuthenticatable
      extend ActiveSupport::Concern

      class_methods do
        Devise::Models.config(self, :jwt_revocation_strategy)
      end

      included do
        def self.find_for_jwt_authentication(sub)
          find_by(self.primary_key.to_sym => sub)
        end
      end

      def jwt_subject
        id
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.07099236641221374, 'fraction_numerical': 0.0, 'mean_word_length': 2.8, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3823083', 'n_tokens_mistral': 416, 'n_tokens_neox': 405, 'n_words': 94}