-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #238 from cbdr/oauth-scopes-fix-and-refactor
This reverts commit c9b3479.
- Loading branch information
1 parent
5ddace5
commit 2634d6d
Showing
17 changed files
with
162 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module APIHelper | ||
def logger | ||
::API.logger | ||
end | ||
|
||
def current_tenant | ||
current_user.tenant | ||
end | ||
|
||
# API Errors | ||
def bad_request! | ||
render_api_error!('(400) Bad Request', 400) | ||
end | ||
|
||
def forbidden! | ||
render_api_error!('(403) Forbidden', 403) | ||
end | ||
|
||
def not_found! | ||
render_api_error!('(404) Not found', 404) | ||
end | ||
|
||
def unauthorized! | ||
render_api_error!('(401) Unauthorized', 401) | ||
end | ||
|
||
def render_api_error!(message, status) | ||
error!({message: message}, status) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.