fix: tests

This commit is contained in:
Shivam Mishra
2024-05-31 18:49:22 +05:30
parent 6ec5bbc2c7
commit ea86184675
2 changed files with 15 additions and 20 deletions
@@ -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)
+9 -14
View File
@@ -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