Skip to content

Commit

Permalink
increase logging
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokant committed Jul 11, 2024
1 parent 243b051 commit d73d94f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/apps/users/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
from django.http import HttpRequest


def report(e):
def report(e, error):
logging.error(str(e))
logging.error(str(error))
try:
from sentry_sdk import capture_exception
from sentry_sdk import capture_exception, set_context

set_context("oauth error", {"error": str(error)})
capture_exception(e)
except Exception:
logging.error(traceback.format_exc())
Expand All @@ -31,7 +33,7 @@ class SocialAccountAdapter(DefaultSocialAccountAdapter):
def on_authentication_error(
self: Self, request, provider, error=None, exception=None, extra_context=None
):
report(exception)
report(exception, error)
return super().on_authentication_error(
request,
provider,
Expand Down
1 change: 1 addition & 0 deletions src/config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@
ACCOUNT_FORMS = {"signup": "apps.users.forms.UserSignupForm"}

SOCIALACCOUNT_ONLY = True
SOCIALACCOUNT_STORE_TOKENS = True
if env("OIDC_CLIENT_ID", default=None):
SOCIALACCOUNT_PROVIDERS = {
"openid_connect": {
Expand Down

0 comments on commit d73d94f

Please sign in to comment.