Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom User subclasses #171

Merged
merged 6 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions django_descope/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import django.contrib.auth.models
from django.db import migrations
from django.conf import settings


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand All @@ -21,7 +21,7 @@ class Migration(migrations.Migration):
"indexes": [],
"constraints": [],
},
bases=("auth.user",),
bases=(settings.AUTH_USER_MODEL,),
managers=[
("objects", django.contrib.auth.models.UserManager()),
],
Expand Down
4 changes: 2 additions & 2 deletions django_descope/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging

from descope import SESSION_TOKEN_NAME
from django.contrib.auth import models as auth_models
from django.contrib import auth
from django.core.cache import cache

from . import descope_client
Expand All @@ -10,7 +10,7 @@
logger = logging.getLogger(__name__)


class DescopeUser(auth_models.User):
class DescopeUser(auth.get_user_model()):
class Meta:
proxy = True

Expand Down