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).

 @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