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

Change token field type from CharField to TextField in AbstractRefres… #1558

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hb-joel
Copy link

@hb-joel hb-joel commented Mar 13, 2025

Fixes #1557

Description of the Change

This pull request changes the AbstractRefreshToken model in django-oauth-toolkit by updating the token field from a CharField to a TextField. This modification allows for greater storage capacity and prevents the django.db.utils.DataError caused by exceeding the character limit (255) for the CharField.

By switching to TextField, we ensure that the refresh token can accommodate larger values, which may be needed as token sizes or encoding formats evolve.

Checklist

  • PR only contains one change
  • Documentation updated to reflect changes made

This PR should resolve the token size issue. Let me know if you need any further adjustments to the description or additional information!

hb-joel and others added 2 commits March 13, 2025 12:12
@n2ygk
Copy link
Member

n2ygk commented Mar 13, 2025

TextFields are not searchable for certain database backends. This feels like something recently discussed in another PR.

@n2ygk
Copy link
Member

n2ygk commented Mar 13, 2025

See #1447

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when creating refresh token: value too long for type character varying(255)
2 participants