fix: tests
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
class Microsoft::CallbacksController < OauthCallbackController
|
||||
private
|
||||
|
||||
def provider_name
|
||||
'microsoft'
|
||||
end
|
||||
|
||||
def handle_response
|
||||
inbox, already_exists = find_or_create_inbox
|
||||
::Redis::Alfred.delete(users_data['email'].downcase)
|
||||
@@ -10,12 +16,6 @@ class Microsoft::CallbacksController < OauthCallbackController
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def provider_name
|
||||
'microsoft'
|
||||
end
|
||||
|
||||
def oauth_client
|
||||
app_id = GlobalConfigService.load('AZURE_APP_ID', nil)
|
||||
app_secret = GlobalConfigService.load('AZURE_APP_SECRET', nil)
|
||||
|
||||
@@ -13,6 +13,14 @@ class OauthCallbackController < ApplicationController
|
||||
|
||||
private
|
||||
|
||||
def provider_name
|
||||
raise NotImplementedError
|
||||
end
|
||||
|
||||
def oauth_client
|
||||
raise NotImplementedError
|
||||
end
|
||||
|
||||
def oauth_code
|
||||
params[:code]
|
||||
end
|
||||
@@ -22,19 +30,6 @@ class OauthCallbackController < ApplicationController
|
||||
end
|
||||
|
||||
def parsed_body
|
||||
@parsed_body ||= Rack::Utils.parse_nested_query(@response.raw_response.body)
|
||||
end
|
||||
|
||||
# These methods should be implemented in the subclasses
|
||||
def oauth_client
|
||||
raise NotImplementedError
|
||||
end
|
||||
|
||||
def provider_name
|
||||
raise NotImplementedError
|
||||
end
|
||||
|
||||
def handle_response
|
||||
raise NotImplementedError
|
||||
@parsed_body ||= @response.response.parsed
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user