lib/wine_bouncer/oauth2.rb in wine_bouncer-0.5.0 vs lib/wine_bouncer/oauth2.rb in wine_bouncer-0.5.1

- old
+ new

@@ -1,8 +1,7 @@ module WineBouncer class OAuth2 < Grape::Middleware::Base - include Doorkeeper::Helpers::Controller ### # returns the api context ### def context @@ -84,25 +83,22 @@ auth_strategy.api_context = context #extend the context with auth methods. context.extend(WineBouncer::AuthMethods) context.protected_endpoint = endpoint_protected? return unless context.protected_endpoint? - self.doorkeeper_request= env # set request for later use. - doorkeeper_authorize! *auth_scopes + self.doorkeeper_request = env # set request for later use. + doorkeeper_authorize!(*auth_scopes) context.doorkeeper_access_token = doorkeeper_token end ### # Strategy ### - def auth_strategy - @auth_strategy - end + attr_reader :auth_strategy private def set_auth_strategy(strategy) @auth_strategy = WineBouncer::AuthStrategies.const_get("#{strategy.to_s.capitalize}").new end - end end