diff --git a/src/sentry/users/services/usersocialauth/model.py b/src/sentry/users/services/usersocialauth/model.py index 0b55f7bce257fd..87708383bec3c0 100644 --- a/src/sentry/users/services/usersocialauth/model.py +++ b/src/sentry/users/services/usersocialauth/model.py @@ -9,6 +9,7 @@ from sentry.hybridcloud.rpc import RpcModel from social_auth.backends import BaseAuth +from social_auth.models import UserSocialAuth from social_auth.utils import get_backend, tokens @@ -26,6 +27,8 @@ def get_backend(self) -> type[BaseAuth] | None: def tokens(self) -> dict[str, Any]: return tokens(instance=self) + def auth(self) -> "UserSocialAuth": + return UserSocialAuth.objects.get(id=self.id).auth() class UserSocialAuthFilterArgs(TypedDict, total=False): id: int