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 #185 from Shopify/revoke_token
Add support for token revocation
- Loading branch information
Showing
3 changed files
with
22 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module ShopifyAPI | ||
class OAuth < Base | ||
self.collection_name = 'oauth' | ||
|
||
def self.revoke | ||
delete(:revoke) | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"permission": { | ||
"access_token": "8ccb0232e04c672bf044f71ff0156098" | ||
} | ||
} |
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,8 @@ | ||
require 'test_helper' | ||
|
||
class OAuthTest < Test::Unit::TestCase | ||
def test_revoke_kills_the_token | ||
fake 'oauth/revoke', method: :delete, body: load_fixture('o_auth_revoke') | ||
assert ShopifyAPI::OAuth.revoke | ||
end | ||
end |