Skip to content

Commit

Permalink
Fix missing Exception in oauth requests (asreview#1467)
Browse files Browse the repository at this point in the history
  • Loading branch information
J535D165 authored Jun 12, 2023
1 parent 2a5aeff commit 7c62977
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions asreview/webapp/authentication/oauth_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class OAuthHandler:
def __init__(self, configs=None):
if not (bool(configs) and isinstance(configs, dict)):
raise "OAuthHandler needs a configuration dictionary."
raise ValueError("OAuthHandler needs a configuration dictionary.")

# check if all necessary config parameters are there
services = {}
Expand All @@ -39,7 +39,7 @@ def __init__(self, configs=None):
]
)
):
raise f"OAuthHandler has insufficient data for f{provider}"
raise ValueError(f"OAuthHandler has insufficient data for {provider}")
else:
# rebuild config
services[provider.lower()] = {
Expand Down Expand Up @@ -76,7 +76,7 @@ def get_user_credentials(self, provider, code, redirect_uri=None):
elif provider == "google":
result = self.__handle_google(code, redirect_uri)
else:
raise f"Could not find provider {provider}"
raise ValueError(f"Could not find provider {provider}")
return result

def __handle_orcid(self, code):
Expand Down

0 comments on commit 7c62977

Please sign in to comment.