lib/doorkeeper/models/access_token_mixin.rb
# Generates and sets the token value with the
# configured Generator class (see Doorkeeper.configuration).
#
# @return [String] generated token value
#
# @raise [Doorkeeper::Errors::UnableToGenerateToken]
#   custom class doesn't implement .generate method
# @raise [Doorkeeper::Errors::TokenGeneratorNotFound]
#   custom class doesn't exist
#
Generates and sets the token value with the
configured Generator class .
Generates and sets the token value with the configured Generator class .
def generate_token
      self.created_at ||= Time.now.utc
      @raw_token = token_generator.generate(
        resource_owner_id: resource_owner_id,
        scopes: scopes,
        application: application,
        expires_in: expires_in,
        created_at: created_at
      )
      secret_strategy.store_secret(self, :token, @raw_token)
      @raw_token
    end
def generate_token self . created_at ||= Time . now . utc @raw_token = token_generator . generate ( resource_owner_id : resource_owner_id , scopes : scopes , application : application , expires_in : expires_in , created_at : created_at ) secret_strategy . store_secret ( self , :token , @raw_token ) @raw_token end
Generates and sets the token value with the
configured Generator class (see Doorkeeper.configuration).
Generates and sets the token value with the configured Generator class ( see Doorkeeper . configuration ) .
generated token value
generated token value
String
[Doorkeeper::Errors::UnableToGenerateToken] custom class doesn't implement .generate method
[ Doorkeeper :: Errors :: UnableToGenerateToken ] custom class doesn ' t implement . generate method
[Doorkeeper::Errors::TokenGeneratorNotFound] custom class doesn't exist
[ Doorkeeper :: Errors :: TokenGeneratorNotFound ] custom class doesn ' t exist