Skip to content

Change access_token and refresh_token to Text type#29

Open
err0rgod wants to merge 1 commit into
fastapi-users:mainfrom
err0rgod:patch-1
Open

Change access_token and refresh_token to Text type#29
err0rgod wants to merge 1 commit into
fastapi-users:mainfrom
err0rgod:patch-1

Conversation

@err0rgod

@err0rgod err0rgod commented Jun 9, 2026

Copy link
Copy Markdown

Changed access_token and refresh_token columns to use Text type for better handling of larger strings.

When using OAuth2 providers such as Authentik with RS256-signed access tokens, the access_token (and sometimes refresh_token) exceeds 1024 characters. This results in a StringDataRightTruncation error in PostgreSQL:
psycopg.errors.StringDataRightTruncation: value too long for type character varying(1024)

  1. Increased access_token and refresh_token field lengths from 1024 to Text type.
  2. Verified behavior against PostgreSQL using long RS256 tokens.
    3.All tests pass with 100% coverage.

Changed access_token and refresh_token columns to use Text type for better handling of larger strings.
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.

1 participant