Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix validation error messages #771

Merged
merged 1 commit into from
Jan 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/doorkeeper/oauth/authorization_code_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AuthorizationCodeRequest
validate :attributes, error: :invalid_request
validate :client, error: :invalid_client
validate :grant, error: :invalid_grant
validate :redirect_uri, error: :invalid_grant
validate :redirect_uri, error: :invalid_redirect_uri

attr_accessor :server, :grant, :client, :redirect_uri, :access_token

Expand Down
2 changes: 1 addition & 1 deletion lib/doorkeeper/oauth/password_access_token_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class PasswordAccessTokenRequest
include OAuth::Helpers

validate :client, error: :invalid_client
validate :resource_owner, error: :invalid_grant
validate :resource_owner, error: :invalid_resource_owner
validate :scopes, error: :invalid_scope

attr_accessor :server, :resource_owner, :credentials, :access_token
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/oauth/authorization_code_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module Doorkeeper::OAuth
it "matches the redirect_uri with grant's one" do
subject.redirect_uri = 'http://other.com'
subject.validate
expect(subject.error).to eq(:invalid_grant)
expect(subject.error).to eq(:invalid_redirect_uri)
end

it "matches the client with grant's one" do
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/oauth/password_access_token_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module Doorkeeper::OAuth
it 'requires the owner' do
subject.resource_owner = nil
subject.validate
expect(subject.error).to eq(:invalid_grant)
expect(subject.error).to eq(:invalid_resource_owner)
end

it 'optionally accepts the client' do
Expand Down