Skip to content

Commit 73cef68

Browse files
djordjetute
authored andcommitted
Grape helper passes doorkeeper headers to error
From https://github.com/intridea/grape#headers: > When raising error!, pass additional headers as arguments. > error! 'Unauthorized', 401, 'X-Error-Detail' => 'Invalid token.' [fixes #682]
1 parent 7e9bc8e commit 73cef68

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ User-visible changes worth mentioning.
1010
the /oauth/token path. Switch from using a DateTime object to update
1111
AR to using a Time object. (Issue #668)
1212
- [#677] Support editing application-specific scopes via the standard forms.
13+
- [#682] Pass error hash to Grape `error!`
1314

1415
## 3.0.0 (rc1)
1516

lib/doorkeeper/grape/helpers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def doorkeeper_render_error_with(error)
2626
403
2727
end
2828

29-
error!({ error: error.description }, status_code)
29+
error!({ error: error.description }, status_code, error.headers)
3030
end
3131

3232
private

0 commit comments

Comments
 (0)