token

jwt_allauth.tokens.tokens module

class jwt_allauth.tokens.tokens.GenericToken(purpose, request=None)[source]

Bases: PasswordResetTokenGenerator

check_token(user, token)[source]

Check that a password reset token is correct for a given user.

make_token(user)[source]

Return a token that can be used once to do a password reset for the given user.

class jwt_allauth.tokens.tokens.RefreshToken(token: Token | None = None, verify: bool = True)[source]

Bases: RefreshToken

classmethod for_user(user, request=None, enabled=True)[source]
Return type:

RefreshToken

set_session(id_=None)[source]

Unique identifier of the session associated to the refresh token.

set_user_attributes(user)[source]

Add configurable user attributes to the token payload. Expects settings.JWT_ALLAUTH_USER_ATTRIBUTES as a dict mapping output claim names to dot-paths on the user object. Example: {‘organization_id’: ‘organization.id’, ‘area_id’: ‘area.id’}

set_user_role(user)[source]

jwt_allauth.tokens.models module

class jwt_allauth.tokens.models.AbstractRefreshToken(*args, **kwargs)[source]

Bases: BaseToken

class Meta[source]

Bases: object

abstract = False
verbose_name = 'refresh token'
verbose_name_plural = 'refresh tokens'
browser

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

browser_version

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

device

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

device_brand

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

device_model

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

enabled

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

ip

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_bot

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_mobile

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_pc

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_tablet

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

jti

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

os

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

os_version

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

session

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class jwt_allauth.tokens.models.BaseToken(*args, **kwargs)[source]

Bases: Model

class Meta[source]

Bases: object

abstract = False
verbose_name = 'refresh token'
verbose_name_plural = 'refresh tokens'
browser

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

browser_version

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

device

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

device_brand

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

device_model

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

ip

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_bot

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_mobile

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_pc

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_tablet

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

os

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

os_version

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class jwt_allauth.tokens.models.GenericTokenModel(id, created, ip, is_mobile, is_tablet, is_pc, is_bot, browser, browser_version, os, os_version, device, device_brand, device_model, user, token, purpose)[source]

Bases: BaseToken

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

browser

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

browser_version

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

device

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

device_brand

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

device_model

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

ip

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_bot

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_mobile

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_pc

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_tablet

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
os

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

os_version

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

purpose

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

token

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

user_id
class jwt_allauth.tokens.models.RefreshTokenWhitelistModel(id, created, ip, is_mobile, is_tablet, is_pc, is_bot, browser, browser_version, os, os_version, device, device_brand, device_model, jti, enabled, session, user)[source]

Bases: AbstractRefreshToken

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

browser

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

browser_version

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

device

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

device_brand

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

device_model

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

enabled

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

ip

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_bot

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_mobile

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_pc

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_tablet

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

jti

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
os

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

os_version

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

session

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

user_id

jwt_allauth.tokens.serializers module

class jwt_allauth.tokens.serializers.GenericTokenModelSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

User model w/o password

class Meta[source]

Bases: object

exclude = ('id',)
model

alias of GenericTokenModel

class jwt_allauth.tokens.serializers.RefreshTokenWhitelistSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

User model w/o password

class Meta[source]

Bases: object

exclude = ('id',)
model

alias of RefreshTokenWhitelistModel