Skip to content

Commit cfa74d6

Browse files
committed
Revert "Fixed custom_attribute validations breaking rails commands"
This reverts commit 46ec2c7.
1 parent 46ec2c7 commit cfa74d6

3 files changed

Lines changed: 2 additions & 20 deletions

File tree

lib/doorkeeper/config/validations.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,11 @@ def validate_token_reuse_limit
5555
def validate_custom_access_token_attributes
5656
return if custom_access_token_attributes.blank?
5757

58-
# Need lib/doorkeeper#configure to set up the orm and initialize
59-
# the access token and grant models before we can access them.
60-
Doorkeeper.configuration
61-
6258
custom_access_token_attributes.each do |attribute_name|
6359
[access_token_model, access_grant_model].each do |model|
6460
next if model.has_attribute?(attribute_name)
6561

66-
raise Doorkeeper::Errors::ConfigError,
67-
"#{model} does not recognize custom attribute: #{attribute_name}. Please disable the " \
68-
"'custom_access_token_attributes' configuration option and make the necessary model changes."
62+
raise Doorkeeper::Errors::ConfigError, "#{model} does not recognize custom attribute: #{attribute_name}."
6963
end
7064
end
7165
end

lib/generators/doorkeeper/templates/initializer.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,7 @@
396396
# The 'authorizations/new' page will need to be overridden to include this additional data
397397
# in the request params when granting access. The access grant and access token models
398398
# will both need to respond to these additional data fields, and have a database column
399-
# to store them in. This configuration option should not be enabled until the access
400-
# grant and access token models repond to the specified attributes.
399+
# to store them in.
401400
#
402401
# Example:
403402
# You have a multi-tenanted platform and want to be able to grant access to a specific

spec/requests/flows/authorization_code_spec.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -579,15 +579,4 @@ def authorize(redirect_url)
579579
expect(access_token.tenant_name).to eq("Tenant 1")
580580
end
581581
end
582-
583-
context "when custom_access_token_attributes aren't recognized by models" do
584-
it "raises a config error" do
585-
expect do
586-
Doorkeeper.configure do
587-
orm DOORKEEPER_ORM
588-
custom_access_token_attributes [:unrecognized_attribute]
589-
end
590-
end.to raise_error(Doorkeeper::Errors::ConfigError)
591-
end
592-
end
593582
end

0 commit comments

Comments
 (0)