Skip to content

fix: use BigInteger for OAuthAccount.expires_at to avoid 32-bit overflow#27

Open
SAY-5 wants to merge 1 commit into
fastapi-users:mainfrom
SAY-5:fix/oauth-expires-at-bigint
Open

fix: use BigInteger for OAuthAccount.expires_at to avoid 32-bit overflow#27
SAY-5 wants to merge 1 commit into
fastapi-users:mainfrom
SAY-5:fix/oauth-expires-at-bigint

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 12, 2026

Copy link
Copy Markdown

Some OAuth providers return expires_at values beyond 2038 (e.g. ORCID sandbox returns 2043), which overflow a 32-bit INTEGER column and cause the insert to fail. Switching the column to BigInteger fixes this on PostgreSQL, MySQL/MariaDB, etc. while remaining a no-op for SQLite.

Closes #1296

@tapetersen tapetersen left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a maintainer but while the change seems reasonable I'm not sure the test is.

Comment thread tests/test_users.py
assert unknown_oauth_user is None


def test_oauth_account_expires_at_is_big_integer():

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test does nothing more than double check a declaration. If a test is warranted it should verify it corrects the original issue, that it accepts dates beyond 2038

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.

2 participants