-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 #1744 from ransombriggs/allow-refresh-tokens-to-be…
…-revoked-after-expire Allow for expired refresh tokens to be revoked
- Loading branch information
Showing
6 changed files
with
164 additions
and
8 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
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,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module RevocableTokens | ||
class RevocableAccessToken | ||
attr_reader :token | ||
|
||
def initialize(token) | ||
@token = token | ||
end | ||
|
||
def revocable? | ||
token.accessible? | ||
end | ||
|
||
def revoke | ||
token.revoke | ||
end | ||
end | ||
end | ||
end |
21 changes: 21 additions & 0 deletions
21
lib/doorkeeper/revocable_tokens/revocable_refresh_token.rb
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,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module RevocableTokens | ||
class RevocableRefreshToken | ||
attr_reader :token | ||
|
||
def initialize(token) | ||
@token = token | ||
end | ||
|
||
def revocable? | ||
!token.revoked? | ||
end | ||
|
||
def revoke | ||
token.revoke | ||
end | ||
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