diff --git a/src/apps/users/adapters.py b/src/apps/users/adapters.py index 7175b05..e629f5b 100644 --- a/src/apps/users/adapters.py +++ b/src/apps/users/adapters.py @@ -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()) @@ -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, diff --git a/src/config/settings/base.py b/src/config/settings/base.py index 13ec449..15987c4 100644 --- a/src/config/settings/base.py +++ b/src/config/settings/base.py @@ -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": {