-
Notifications
You must be signed in to change notification settings - Fork 592
Open
Description
Description
I'm experiencing a database error when using OAuth authentication with Twill. The OAuth tokens being generated are longer than the current 255-character limit set for the token
column in the twill_users_oauth
table, causing SQL errors during token storage.
The error occurs when attempting to store OAuth tokens that exceed the VARCHAR(255) limit defined in the migration file.
Steps to reproduce
- Enable OAuth authentication in Twill configuration (
twill.enabled.users-oauth
= true) - Set up OAuth provider (the specific provider may vary, but tokens can be lengthy)
- Attempt to authenticate via OAuth
- The authentication process fails when trying to store the token in the database
Expected result
OAuth tokens should be successfully stored in the database regardless of their length, allowing users to authenticate properly through OAuth providers.
Actual result
The following SQL error is thrown:
Error 500 SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'token' at row 1
(Connection: mysql, SQL: update `twill_users_oauth` set `token` =
ya29.A0EXAMPLE_TOKEN_HERE_THAT_IS_VERY_LONG_AND_EXCEEDS_255_CHARACTERS_LIMIT_ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,
`twill_users_oauth`.`updated_at` = 2025-06-24 16:24:58 where `id` = 3)
Versions
- Twill version: 3.1.0
- Laravel version: 10.39.0
- Database engine: MariaDB
Metadata
Metadata
Assignees
Labels
No labels