How can I use social_django with strawberry graphql? With graphene
, I inherited my strawberry.type
from SocialAuthJWT
I used in grapgene like this.
class SocialAuth(graphql_social_auth.SocialAuthJWT):
user = graphene.Field(UserType)
@classmethod
def resolve(cls, root, info, social, **kwargs):
social.user.is_verified = True
social.user.save()
token = get_token(social.user)
return cls(user=social.user, token=token)
I'd like to log in with google.
Made a library for this inspired by nrbnlulu/strawberry-django-auth
Check it out here
Build your schema like this
Call it like this:
You can also extend the
SocialAuthMixin
to customize the behavior of your SocialAuth:)