ExpiringTokenGenerator
ExpiringTokenGenerator implements single-use authentication tokens that expire after a configurable amount of time (24 hours by default). It is designed to be used in scenarios such as password reset links or email confirmation links, but could be used in other scenarios as well.
Django token generators for single-use authentications.
- class smarter.lib.django.token_generators.ExpiringTokenGenerator(expiration=86400)[source]
Bases:
PasswordResetTokenGeneratorAn object of this class can generate a token that expires after a certain amount of time.
- decode_link(uidb64, token)[source]
Extract the user from the uid and token and validate.
- Return type:
- exception smarter.lib.django.token_generators.SmarterTokenConversionError(message='')[source]
Bases:
SmarterTokenError
- exception smarter.lib.django.token_generators.SmarterTokenError(message='')[source]
Bases:
SmarterExceptionBase class for all token-related exceptions.
- exception smarter.lib.django.token_generators.SmarterTokenExpiredError(message='')[source]
Bases:
SmarterTokenError
- exception smarter.lib.django.token_generators.SmarterTokenIntegrityError(message='')[source]
Bases:
SmarterTokenError
- exception smarter.lib.django.token_generators.SmarterTokenParseError(message='')[source]
Bases:
SmarterTokenError