Skip to content

Commit 3c0f2ce

Browse files
Fix: increase access and refresh token field length to 4096 (#1523)
1 parent 6397ace commit 3c0f2ce

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

fastapi_users_db_sqlalchemy/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ class SQLAlchemyBaseOAuthAccountTable(Generic[ID]):
6969
oauth_name: Mapped[str] = mapped_column(
7070
String(length=100), index=True, nullable=False
7171
)
72-
access_token: Mapped[str] = mapped_column(String(length=1024), nullable=False)
72+
access_token: Mapped[str] = mapped_column(String(length=4096), nullable=False)
7373
expires_at: Mapped[Optional[int]] = mapped_column(Integer, nullable=True)
7474
refresh_token: Mapped[Optional[str]] = mapped_column(
75-
String(length=1024), nullable=True
75+
String(length=4096), nullable=True
7676
)
7777
account_id: Mapped[str] = mapped_column(
7878
String(length=320), index=True, nullable=False

fastapi_users_db_sqlalchemy/access_token.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class SQLAlchemyBaseAccessTokenTable(Generic[ID]):
2121
created_at: datetime
2222
user_id: ID
2323
else:
24-
token: Mapped[str] = mapped_column(String(length=43), primary_key=True)
24+
token: Mapped[str] = mapped_column(String(length=4096), primary_key=True)
2525
created_at: Mapped[datetime] = mapped_column(
2626
TIMESTAMPAware(timezone=True), index=True, nullable=False, default=now_utc
2727
)

0 commit comments

Comments
 (0)