Skip to main content

Graphql authentication system with Strawberry for Django.

Project description

Tests Codecov Pypi contributions welcome Pypi downloads Python versions

Strawberry-django Auth

Django registration and authentication with Strawberry.

Demo

Demo Video

About

This Library was inspired by Django-graphql-auth.

Abstract all the basic logic of handling user accounts out of your app, so you don't need to think about it and can get you up and running faster.

No lock-in. When you are ready to implement your own code or this package is not up to your expectations , it's easy to extend or switch to your implementation.

Docs can be found here

Features

  • Awesome docs!
  • Captcha validation
  • Async/Sync supported!
  • Works with default or custom user model
  • JWT authentication (with Strawberry Django JWT)
  • User registration with email verification
  • Add secondary email, with email verification too
  • Resend activation email
  • Retrieve/Update user
  • Archive user
  • Permanently delete user or make it inactive
  • Turn archived user active again on login
  • Track user status (archived, verified, secondary email)
  • Password change
  • Password reset through email
  • Revoke user tokens on account archive/delete/password change/reset
  • All mutations return success and errors
  • Default email templates (you will customize though)
  • Customizable, no lock-in
  • Passwordless registration
  • Currently, only mutations are compatible with Relay

Full schema features

import strawberry
from gqlauth.user import arg_mutations as mutations


@strawberry.type
class AuthMutation:
    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
    password_change = mutations.PasswordChange.field
    archive_account = mutations.ArchiveAccount.field
    delete_account = mutations.DeleteAccount.field
    update_account = mutations.UpdateAccount.field
    send_secondary_email_activation = mutations.SendSecondaryEmailActivation.field
    verify_secondary_email = mutations.VerifySecondaryEmail.field
    swap_emails = mutations.SwapEmails.field
    captcha = mutations.Captcha.field

    # django-graphql-jwt authentication
    # with some extra features
    token_auth = mutations.ObtainJSONWebToken.field
    verify_token = mutations.VerifyToken.field
    refresh_token = mutations.RefreshToken.field
    revoke_token = mutations.RevokeToken.field


schema = strawberry.Schema(mutation=AuthMutation)

Contributing

See CONTRIBUTING.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

strawberry-django-auth-0.3.5.2.tar.gz (470.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strawberry_django_auth-0.3.5.2-py3-none-any.whl (476.7 kB view details)

Uploaded Python 3

File details

Details for the file strawberry-django-auth-0.3.5.2.tar.gz.

File metadata

  • Download URL: strawberry-django-auth-0.3.5.2.tar.gz
  • Upload date:
  • Size: 470.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.4 Linux/5.15.0-47-generic

File hashes

Hashes for strawberry-django-auth-0.3.5.2.tar.gz
Algorithm Hash digest
SHA256 20db9fa506c6ece29f70e6ffd4bdd532207fcb3c4325ae14dc5e465f0a78464d
MD5 aabff00868c4b2683f49178691656d79
BLAKE2b-256 1a1e002ca131d86d8d9e5243ef3ed524eac9af0815251e05895706d7bc07a22f

See more details on using hashes here.

File details

Details for the file strawberry_django_auth-0.3.5.2-py3-none-any.whl.

File metadata

File hashes

Hashes for strawberry_django_auth-0.3.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c2fedc8cae07da86cfe0c656842924727d21ec21ee338f9a5426661a4901853a
MD5 c1b1175ccb81ca8df6d2894719880288
BLAKE2b-256 a71bbb0dbb7a344f10d28eb5a9196a204c013f074429ccb101831e7f118b1154

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page