Package: django-graphene-auth
Django Graphene AuthDjangoGraphQL registration and authentication
compatible with the latest versions of Django, Django GraphQL JWTAboutThis project was based on the forked repository fromDjango GraphQL Auth-
created byPedro Bern(thanks so much for a great job).The reason I decided to create this project is that the original doesn't support
the newer versions of django, graphene-django and django-graphql-jwt.
Futhermore, it appears that the original one will not be further developed in the near future.DocumentationDocumentation is available atread the docs.FeaturesDocsFully compatible withRelayWorks withdefault or customuser modelJWT authentication(withDjango GraphQL JWT)User query with filters(withDjango FilterandGraphene Django)User registration with email verificationAdd secondary email, with email verification tooResend activation emailRetrieve/Update userArchive userPermanently delete user or make it inactiveTurn archived user active again on loginTrack user status (archived, verified, secondary email)Password changePassword reset through emailRevoke user refresh tokens on account archive/delete/password change/resetAll mutations returnsuccessanderrorsDefault email templates(you will customize though)Customizable, no lock-inFull Schemaimportgraphenefromgraphql_auth.schemaimportUserQuery,MeQueryfromgraphql_authimportmutationsclassAuthMutation(graphene.ObjectType):register=mutations.Register.Field()verify_account=mutations.VerifyAccount.Field()resend_activation_email=mutations.ResendActivationEmail.Field()send_password_reset_email=mutations.SendPasswordResetEmail.Field()password_reset=mutations.PasswordReset.Field()password_set=mutations.PasswordSet.Field()# For passwordless registrationpassword_change=mutations.PasswordChange.Field()update_account=mutations.UpdateAccount.Field()archive_account=mutations.ArchiveAccount.Field()delete_account=mutations.DeleteAccount.Field()send_secondary_email_activation=mutations.SendSecondaryEmailActivation.Field()verify_secondary_email=mutations.VerifySecondaryEmail.Field()swap_emails=mutations.SwapEmails.Field()remove_secondary_email=mutations.RemoveSecondaryEmail.Field()# django-graphql-jwt inheritancestoken_auth=mutations.ObtainJSONWebToken.Field()verify_token=mutations.VerifyToken.Field()refresh_token=mutations.RefreshToken.Field()revoke_token=mutations.RevokeToken.Field()classQuery(UserQuery,MeQuery,graphene.ObjectType):passclassMutation(AuthMutation,graphene.ObjectType):passschema=graphene.Schema(query=Query,mutation=Mutation)RelayImport mutations from therelaymodule:fromgraphql_authimportrelayclassAuthMutation(graphene.ObjectType):register=relay.Register.Field()# ...ExampleHandling user accounts becomes super easy.mutation{register(email:"new_user@email.com",username:"new_user",password1:"123456super",password2:"123456super",){success,token,# optional, depending on settings of GRAPHQL_AUTH['ALLOW_LOGIN_NOT_VERIFIED']refreshToken# optional, depending on settings of GRAPHQL_JWT['JWT_LONG_RUNNING_REFRESH_TOKEN']}}Check the status of the new user:u=UserModel.objects.last()u.status.verified# FalseDuring the registration, an email with a verification link was sent.mutation{verifyAccount(token:"<TOKEN ON EMAIL LINK>",){success}}Now user is verified.u.status.verified# TrueCheck theinstallation guide. Or if you prefer, browse theapi.