-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
Description
In our application we allow client to pass access tokens(optional) for GET requests for analytics and reports. But if client pass very old access token which is expired in request gem does not Unauthorized the request. For which I am doing following change in the code.
lib/grape_oauth2/helpers/access_token_helpers.rb
def current_access_token
@_current_access_token ||= request.env[Rack::OAuth2::Server::Resource::ACCESS_TOKEN]
(@_current_access_token.present? && (@_current_access_token.revoked? || @_current_access_token.expired?)) ? (raise Rack::OAuth2::Server::Resource::Bearer::Unauthorized) : @_current_access_token
end
Is this a valid change? or I am missing something?